On 07/12/2005, at 11:06 AM, Peter Meyer wrote:
it would seem to be a simple query but how do you create a formula in FMpro 8 that will calculate ages accurately - all the options/ permutations of DATE functions i have tried have a problem with leap-years ie they will calculate ages accurately for birth-dates _not_ in a leap-year but for those people born in a leap-year, they have to wait for an extra day to grow older. so, eg: if someone had a birthday yesterday, born in 2000 they would not be calculated to be 5 years old until today whereas someone born on 6/12/2001 would have had their 4th birthday yesterday.
I have seen some incredibly complex solutions to this problem, but I can't really see what's wrong with the simple and straightforward approach of
Int ( (Get ( CurrentDate ) - Birthdate) / 365.25 ) -- Peter Hinchliffe Apwin Computer Services FileMaker Pro Solutions Developer Perth, Western Australia Phone (618) 9332 6482 Fax (618) 9332 0913 -------------------------------------------------------------------- Mac because I prefer it -- Windows because I have to.