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.

newbie date range calculations

Featured Replies

  • Newbies

Hello,

I'm very new to filemaker, and am essentially trying to find date ranges using calculations, and then wether the record falls within that range determines what is displayed in the calculation field.

I have a date field, and a tax year field.

I want the tax year to show, e.g. "2011-12" if a record in the date field is between the range 06/04/2011 and 05/04/2012.

Any ideas how to do this using a calculation field or are there better ways of approaching this?

Any help would be much appreciated!

I would use an additional table that stores the start and end date for your range with the text to display which in this case is "2011-12".

The relationship between the two tables would be keyed from the date field to the start date field of the other table using

datefield >= StartDate

datefield <= EndDate

I want the tax year to show, e.g. "2011-12" if a record in the date field is between the range 06/04/2011 and 05/04/2012.

Does your fiscal year always begin on April 6?

  • 2 weeks later...
  • Newbies

I don't think you need another table/table occurrence, unless the fiscal year would have properties of its own to keep track of. But if you simply want to display it correctly (and assuming the boundary will remain 6 April for the time being), you could use:

Let([

theDate = myTable::transactionDate ; // insert your date field here

theYear = year( theDate ) ;

startFiscalMonth = 4 ;

startFiscalDay = 6

// or, preferably, global fields/global variables/fields from a utility table containing these numbers, to avoid hard-coding

];

If( theDate < Date( startFiscalMonth; startFiscalDay ; theYear ) ; // i.e. compare with 6 April the same year

GetAsText( theYear - 1 ) & "-" & Right( GetAsText( theYear ) ; 2 ) ; // display like 2012-13

GetAsText( theYear ) & "-" & Right( GetAsText( theYear + 1 ) ; 2 )

)

)

HTH, Peter

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.