For you FileMaker Pro Advanced users out there...
If you have several date fields and would like to calculate years elapsed (for example a person's age) here is a custom function that will do it.
Of course it is a simple calculation and could be typed each time you need it in a calculation field, but this is designed to be used in several places where needed.
Examples:
If you have several date fields and would like to calculate years elapsed (for example a person's age) here is a custom function that will do it.
Of course it is a simple calculation and could be typed each time you need it in a calculation field, but this is designed to be used in several places where needed.
Examples:
- Age
- Years of service since hire date
- Years married
You get the idea.
/**
* =====================================
* YearsElapsed ( startDate )
*
* PURPOSE:
* Convenience function for working with
* dates to calculate age or years elapsed to current date.
*
* RETURNS:
* (number)
*
* PARAMETERS:
* startDate = Field reference
*
* EXAMPLES:
* YearsElapsed ( dateBirth ) = 46.7
* YearsElapsed ( dateHired) = 2.7
*
* DEPENDENCIES:
* none
*
* NOTES:
* This is simply a helper function to avoid having excessive amounts of
* similar code within a FileMaker solution.
*
* HISTORY:
* MODIFIED on Monday, September 16, 2013 by Robert Kuivanen - added
*
* REFERENCES:
* (see YearsElapsed custom function)
* =====================================
*/
Truncate ( ( Get ( CurrentDate ) - startDate ) / 365.2425; 1 )
Comments