Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I find the age of a person from a query on a given date from the date of birth.

I want to run a query that will return the age of everyone in a table, on any date of the following year calculated from their date of birth.

I want to return the age in years they will be, say on the 01/09(September) of the next year.

Todays date is 02/09/2015

If the date of birth is 09/10/2006 the answer is 9
If the date of birth is 28/01/2006 the answer is 10

Any ideas?? Anyone?
Posted
Comments
Patrice T 2-Sep-15 19:12pm    
What have you done so far ?
Where is your problem ?
Member 10354489 2-Sep-15 20:23pm    
I've tried the DateDiff function, but I can only return an answer based on two specific date values. I need to return the age in years on all fields based on the date of birth field for each person in the table. The return will be the age they are at a certain date. It's for a sports club to get a list of all who can compete at a specific age level.
I hope this clarifies where I'm coming from.
Thanks.
Patrice T 2-Sep-15 20:27pm    
Can't you loop and apply the Datediff function to each person ?

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900