Brian Dunning's FileMaker Custom Functions

CF_DateInterval ( FI ; FF )

This function determines the interval between two dates.

  Average rating: 2.0 (1 vote) Log in to vote

Carlos Bittar   Carlos Bittar
none
no web site, sorry

Share on Facebook Share on Twitter

  Sample input:
CF_DateInterval (04/20/1980; 02/15/2018)

CF_DateInterval (12/31/2017; 02/15/2018)

CF_DateInterval (12/10/2017; 12/14/2018)
  Sample output:
37 years 9 months 25 days

1 month 15 days

1 year 4 days

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

This function determines the interval between two dates, even considers leap years. Due to the way both dates of the time interval are broken down, this function can be used in mm/dd/yyyy and dd/mm/yyyy format.
Date 2 must be iqual or greater than Date 1.
Please do not change the order of the calculations, otherwise it won't work.
I hope you'd liked this.

 

Comments

19752   19752, fmc
Feb 12, 2018
I'd calculate year to day order, so on the first sample it would be 37 years 9 months 26 days.
(37 years and 9 month after 4/20/1980 is 1/20/2017, so 2/15/2017 is 26 days after.)
 

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 20 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: