I need to calculate current age of person from DOB in a query that can later be summarized by gouping all of the same age together in a report. Help, please.
I need to calculate current age of person from DOB in a query that can later be summarized by gouping all of the same age together in a report. Help, please.
Take a look at: http://office.microsoft.com/en-gb/ac...001055071.aspx
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
I checked out the link you provided but it talks about getting age calculation in a form. I have done that already but want to be able to do it in a query so that it can be incorporated into a report with other summarized information.
So why not create a field in the query that calculates the age using the expression.
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
I would if I could get it to work, but it doesn't. I'm by no means a pro at Access but have researched and can't figure out a way to get it into a query. I've found some articles that say it doesn't work in a query at all so not sure. The calculation for a form is all I could find. Can't even get it to work in the main table. I may be way off base with what I'm trying but if someone could give me detailed steps, I would greatly appreciate it. Thanks!
DateDiff certainly will work in a query. However, not understanding the calc in that link.
"It doesn't work" doesn't help us help you. What happens - error message, wrong results, nothing?
Post the SQL statement for analysis. Something like:
SELECT *, DateDiff("yyyy", [Birthdate], Now()) AS Age FROM tablename;
How precise do you want the age calc? That calc rounds to whole year. Anyone born in 2013 will have age 0. Birthdate of 2003 will show 10 years even if BD was 1/1/2003.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.