Brian Dunning's FileMaker Custom Functions

DateDifferenceInMonths

Calculates the number of months difference between two dates, where Date2 is later than Date1.

  Be the first to rate this function Log in to vote

simes   simes - Show more from this author

  Sample input:
DateDifferenceInMonths ( Date1 ; Date2 )
  Sample output:
01/01/2014 - 02/28/2014 = 2 months

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

Republished from:
https://support.claris.com/s/article/Calculation-for-Elapsed-Months-1503692919780

Example:
Current date (Date1): 29/03/2024 - End of contract (Date2): 09/05/2025 = End of contract: 13 Months (DateDifferenceInMonths)

 

Comments

Richard DeShong   Richard DeShong, Logic Tools
Oct 16, 2025
Hi simes, thanks for posting the code from the Claris article. Please consider MonthsBetween(), as it returns a real number (x.xxx) representing the full and partial months between. That give you the option of using Int(), Round(), or Max(), as needed.
 
simes   simes
Oct 17, 2025
Consider your custom function called: MonthsBetween() ? thanks, will check it out
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. 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 21 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: