no it still has the problem - it's fine with calculating age when the DOB is in a normal year but fails for, say 1940 [a case of you have to have been born yesterday to have a birthday today :^)]

i hadn't tried *Int* but had used other functions (eg floor, truncate) with ( (Get ( CurrentDate ) - Birthdate) / 365.25 ) - but there presumably wouldn't be any reason to expect that to be the offending part anyway?

and i have also checked out the pre-March aspects now and no, it doesn't disappear there; just shifts the problem from the leap-year DOBs to the others; except for Feb 29!

as you imply: maybe the *solution* is to do something else and somehow flag the likely problem dates on the instance of a particular calculation - and resort to a bit of manual, sorry - mental arithmetic!

thanks anyway…


On 08/12/2005, at 7:59 AM, Peter Hinchliffe wrote:


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.



mouse    peter meyer
0408 902349
[EMAIL PROTECTED]