Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Converting Today's Date to a School Year

Featured Replies

  • Newbies

I am writing a database using FMPro 5 for a school tracking project. I need to convert the actual date into a year range related to the current school year. For example,

Jan 22, 1999 becomes 1998-1999

March 1, 2000 becomes 1999-2000

Since the school year runs July 1 to June 30th. I've been trying to do it using a series of IF/THENs in a script after breaking apart the date into month and year. Is there an easier way?

Try using the following calculation for the School Year field (Result should be text)???

Case(vDate > 731031, "2002/03", vDate > 730666, "2001/02" , vDate > 730301, "2000/01", vDate > 729936, "1999/00", "1998/99" )

vDate is the your date field.

You may add as many years as you like ot this calculation.

The large numbers are the day numbers that Filemaker uses for calculations. Entering dates as 30/6/2000 will not work. 30/6/2001 has a day number of 730666. You can get othe years by addingor subtracting 365 (Except of course for leap years!)

Hope this helps.

I would suggest creating a calculation field rather than a script to do the job in question. The calculation could look something like the following:

Case(Month(Status(CurrentDate))<7, Year(Status(CurrentDate))-1 & " - " & Year(Status(CurrentDate)),

Year(Status(CurrentDate)) & " - " & Year(Status(CurrentDate))+1)

The CASE function, similar to the IF function evaluates the month of the current date. It then generates the text result to show the fiscal year you are in.

Hope this helps.

Sorry if my post wasn't clear. I was indeed suggesting using a calculation field using the calculation I gave. Birdman's calculation is probably neater.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.