Age in reports

D

Dave

Hi

Hope you can help with this one. I need a report to show peoples ages based
on their birthday. I have 4 fields on the report. Ths first is simply
their name. The second is their date of birth. The third needs to show how
many days old they are and the final one how old they are in years. For the
third field I am using the formula =(now())-[dob]. Can i get it so it only
show days and ignores the time element of it? For the final colum all I
want to do is to divide the value from the third column over 365 (im
ignoring leapyears for now), how can i do this so that it shows only the
full completed years and does not display the decimals after the integar?

Thanks
 
D

Dave

Thanks

Allen Browne said:
Use Date() instead of now, i.e.:
=Date() - [dob]
Alternatively:
=DateDiff("d", [dob], Date())

You can get an approximation of the age as:
=Int((Date() - [dob]) / 365.25)

For the exact age in years, see:
http://allenbrowne.com/func-08.html
or for the age in years, months, and days, see:
http://www.accessmvp.com/djsteele/Diff2Dates.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Dave said:
Hi

Hope you can help with this one. I need a report to show peoples ages
based on their birthday. I have 4 fields on the report. Ths first is
simply their name. The second is their date of birth. The third needs
to show how many days old they are and the final one how old they are in
years. For the third field I am using the formula =(now())-[dob]. Can i
get it so it only show days and ignores the time element of it? For the
final colum all I want to do is to divide the value from the third column
over 365 (im ignoring leapyears for now), how can i do this so that it
shows only the full completed years and does not display the decimals
after the integar?

Thanks
 
A

AlCamp

Dave,
Check out the DateDiff function...
[ThirdField] = DateDiff("d",Date(),DOB)
[FourthField] = Int([ThirdField] / 365)
hth
Al Camp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top