YearMinus ( TheDate )
Subtract one year from a given date
Average rating: 4.2 (30 votes) Log in to vote
crisix Stefan Pusch KG http://www.base72.com |
YearMinus ( 733466 )
YearMinus ( "2/29/2008" )
YearMinus ( 733101 )
733101
2/28/2007
732735
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Returns a date 1 year before the given date calculating leap years, too.
E.g., February 29th, 2000 will return February 28th, 1999
February 28th, 2001 will return February 29th, 2000
Input value may be formatted as Date or Text (e.g. 2/28/2001 or 28.2.2001, depending on System Formats) or as Number (number of days from 1/1/0001)
Output format depends on formatting of the calculation field, either as Text, Date or Number.
If the input value cannot be interpreted as a valid date, an error 0 (zero) is returned.
NOTE: This function is only valid for dates between 1901 to 2099. Complete support of Gregorian dates may follow.
Comments
comment, VR Apr 7, 2011 |
||
Why not use a simple = Date ( Month ( date ) ; Day ( date ) ; Year ( date ) + 1 ) This maps February 29 to March 1 in the preceding/following year, which IMHO is just as reasonable as February 28 - and it will work across the entire Filemaker era of 4,000 years. |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.