![](https://secure.gravatar.com/avatar/f174b9816ccce31bf5cdb49501b15358.jpg?s=120&d=mm&r=g)
2 Dec
2007
2 Dec
'07
8:48 p.m.
In Analysis, if your variables are:
DOB - date of birth SOMDAT - date at which you wish to know age in years
define age ### age = year(somdat) - year(dob) - iif(dmy(day(dob),month(dob),year(somdat)) > somdat,1,0)
This just finds the difference in years and then subtracts one if the birthday in the comparison falls after the date SOMDAT. The Help for EpiData Entry gives an approximate way of doing this as well. The above method will never be wrong.
Jamie
Gaspar wrote:
I need some help to figure out an age at a given date. For instance: what is the age of someone born in 15/june/1970 on this date: 31/dec/2006?