Page 1 of 1

how to find Age --using DOB and currDate

Posted: Wed Aug 27, 2008 6:09 pm
by reddysrc
Hi Experts,


I had a req to find member_Age using his DateOfBirth and currrentDate()
finally a need to get Age in years.

i am using 7.5 Parallel in AIX env.

Posted: Wed Aug 27, 2008 6:35 pm
by chulett
How about DaysFromDateSince() and then divide by 365?

Posted: Wed Aug 27, 2008 8:46 pm
by ray.wurlod
365.25 would be closer, and 365.249 even closer (for really long-lived folks). But better would be to compare the dates properly - subtract the years and then add one if the birthdate has already gone past in the current year.

Beware of other cultural conventions. In some Chinese applications, a child is deemed to be 1 at birth. This would affect your arithmetic.