Calculating age using diff2dates

N

Nikkiewolf

Can anyone help?

I need to calculate age in years, months and days from a date field. I
found an early post and tried the suggested 'diff2dates' function but cannot
get it to work. The result in my age field is '#name?'. I've tried the
datediff function on the same field and successfully get the number of years
difference so I am not sure what I am doing wrong. I am fairly new to
Access so that has probably got something to do with it.

Many thanks,
Nikkie
 
J

John Spencer MVP

It would help if you posted what you tried. You should be using something like:
Diff2Dates("ymd",SomeDate,SomeOtherDate,True)


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
N

Nikkiewolf

Hi John,

Thanks for responding to my post. I thought the 'Show Zero' was optional so
after looking at your example I've just tried adding 'True' to my code and it
all works now.

Thanks again!
Nikkie
 
J

John Spencer MVP

The show zero is optional.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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

Top