MS-Access / VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to calculate an individual's age but all the formulas that I have seen
or try seem to calculate years only. I need to calculate a result of years
and months to compare ages at the month level. Does anyone know of a formula
or a function that will accurately calculate a person's age and return the
result in years and months?
 
You can get the number of months:

months = DateDiff("m", DateOfBirth, Date)

and then extract the number of years

years = months \ 12

finally you get the result:

Debug.Print "Years: " & years, "Months: " & months -
years*12

HTH
 

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

Back
Top