Date Query - Ages?

mmshafi

New member
Local time
Today, 10:24
Joined
Jun 21, 2010
Messages
1
In querry want to calculate age in years & months. already uses datediff() "YYYY" function. it gives only years. should be a way in single statement to clalculate years & months same time.
 
You can use the datediff() function with the month option and incorporate some calculations to split into years and months. The following is not tested:

Int(datediff("m", date(), dateofbirth)/12) & " years and " & datediff("m",date(), dateofbirth)-(Int(datediff("m", date(), dateofbirth)/12)*12) & " months"
 

Users who are viewing this thread

Back
Top Bottom