lastMonth ( theDate )
Give you the last month in number
Average rating: 4.5 (18 votes) Log in to vote
Jo Des Rosiers Company http://google.com |
lastMonth(Date (1;20;2015))
lastMonth(Date (10;7;2015))
12
9
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Give you the last month in number. If the date is an empty string it will depend on the current date.
Comments
unix, Japan Mar 1, 2016 |
||
Let ( cd = Get ( CurrentDate ) ; Month ( cd - date( cd ) ) ) Using Let() save change of current data in calculating. |
||
Bernamo, Belgium Mar 2, 2016 |
||
Hello unix, I presume "date( cd )" must be "month( cd )" ? Best regards. |
||
Jo, Switzerland Mar 3, 2016 |
||
I edited the function to take a date in parameter. If you give and empty string it will work like the last version. | ||
unix, Japan Mar 3, 2016 |
||
Thanks Bernamo, It should be Day( cd ). (And "current data" should be "current date", of course) aDate - Day ( aDate ) returns the last date of previous month. I frequently confuse date and day... |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.