Brian Dunning's FileMaker Custom Functions

LastMonth_withYear ( Date2Process )

Calculate the last month and also include the year

  Average rating: 4.3 (4 votes) Log in to vote

João Coutinho   João Coutinho - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
  Sample output:

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

When you need to calculate the last month to make searches on the Database, it's difficult to have a good result when you are in January. This function resolves this problem calculating the last month and also including the correct year.



19752   19752, fmc
Jan 11, 2018
You can get the last day of the last month as date-Day(date), then this can be

Let (
d = Date2Process - Day ( Date2Process ) ;
SerialIncrement ( "00/" ; Month ( d ) ) & Year ( d )
João Coutinho   João Coutinho
Jan 12, 2018
Thanks for the suggestion.
But I used this custom function for searches, so I really don't need the day.

Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: