DateDif ( date1 ; date 2 ; flag )
Simulates Excel function of same name and provides for text labeling with correct grammer.
Average rating: 4.5 (35 votes) Log in to vote
Brett Buchmiller No Company http://filemaker.com |
DateDif( 11/2/2006 ; 7/6/2011 ; "T" )
DateDif( 11/2/2006 ; 7/6/2011 ; "LIST" )
4 years, 8 months and 4 days
4
8
4
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Based on the excellent algorithm by Winfried Huslik but adapted for multiple uses based on flag. Works similar to DateDif() function in excel where flag determines if returns years, months or days between dates. Additional flags allow for text string with proper grammer or list of values to be accessed by LeftValues(), MiddleValues() or RightValues.
Comments
Daniele Raybaudi, ACI Aug 8, 2011 |
||
Hi what if a date is empty ? |
||
Daniele Raybaudi, ACI Aug 8, 2011 |
||
What about: ... d1 = Min ( date1 ; date2 ) ; d2 = Max ( date1 ; date2 ) ; ... |
||
DJ, NM Nov 3, 2014 |
||
Using the dates 02/01/2015 and 11/30/2015 returns the wrong result. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.