Brian Dunning's FileMaker Custom Functions

Days_Diff ( date1 ; date2 )

Days difference part between two dates.

  Average rating: 4.0 (32 votes) Log in to vote

Ron Smith   Ron Smith - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
Days_Diff ( 7/14/1958 , 9/8/2006 )
  Sample output:
11

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

/* Days_Diff ( date1 ; date2 )
This code find the days part of a years-months-days age calculation.
You only need to enter the two dates in any order.
This code takes in the account the 'end of month paranoia' that comes from
different lengths of months. For example, the ages for the following birth dates
are the same.
Birth Current Date Age
12/28/2006 3/1/2007 0 years 2 months 1 day
12/31/2007 3/1/2007 0 years 2 months 1 day

This occurs because February has only 28 days. Though at first this seems wrong,
think about how you would explain how old your child is in months and days. If you
were calculating the total number of days, however they of course differ. This highlights
the ideosyncracy of using a years, month, and days discreption of age. Still it is useful
in the context of ages in the managing vaccinations in kids or studying ages in
genealogy.
*/

 

Comments

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

Under construction. Email me your wish list for improvements.