3 Replies Latest reply on Aug 31, 2014 3:34 PM by schamblee

# Determining if date is before a certain day of year

### Title

Determining if date is before a certain day of year

### Post

I use Filemaker Pro for academic records, and I need to use it to determine the graduation year for students.  I have narrowed it down to a simple algorithm (I think), but I can not figure it out how to do it.

I want the database to determine whether the current date is before a certain day of the year regardless of the actual year.  For example, if the current date is before June 1st of a given year, it should return the current year. If it is after June 1st, it would return the current year plus one.

So, if the date is May 20, 2014, it would return "2014."  If the date is August 6, 2014, it would return 2015 (because 2014 + 1).

Most of the date calculations include a specific year, and I want the calculation to work regardless of the year.

• ###### 1. Re: Determining if date is before a certain day of year

I use a bit of logic like this (It's getting the date of the record, not current date, we split our year at June/July, and I label the folders they end up in in the Hebrew calendar year)

If(Month ( Purchase Orders::Date ) > 6; Year ( Purchase Orders::Date ) + 3761; Year ( Purchase Orders::Date ) + 3760)

I think you can change it. Try...

If(Month ( Get(CurrentDate) ) > 5; Year ( Get(CurrentDate) + 1); Year ( Get(CurrentDate) ) )

• ###### 2. Re: Determining if date is before a certain day of year

I see the logic here, but it does not seem to add one to the year.  For example, with the current date as it is, the value should be 2015, but it shows 2014.  I have changed the computer's date to troubleshoot the calculation, but it only ever shows the current year.

• ###### 3. Re: Determining if date is before a certain day of year

Try this Calculation If (Month(Get(CurrentDate)) < 6; Year(Get(CurrentDate));Year(Get(CurrentDate))+1)

The above calculation from Adam Anklewicz looks correct and should do the same thing.

Note that the calculation has to be an non stored calculation to update when the date changes.  Under storage options click do not store recalculate when needed.