DateDiff - need years and months

B

Bonnie A

Hi everyone! Using A02 on XP.

I have rates to calculate frequently and have to calculate how many years
and months between two dates (day of the month isn't needed but I don't mind
using it). I made a form with [StartDate] and [EndDate] and a Result field
with this in the Control Source:

=DateDiff("d",[StartDate],[EndDate])

I can calc the number of days but need months and years (for example; 3 yrs,
5 mos and 18 days).

I've tried to play with it but it just errors. What is the proper form to
use for 'show it to me this way'?

Thank you in advance for any help or advice!
 
B

Bonnie A

Thank you VERY much Allen. I discovered all I needed was "ymd". I tried
"dmy" and got errors.

I appreciate the time you take to help others. I LOVE Access!
--
Bonnie W. Anderson
Cincinnati, OH


Allen Browne said:
Doug Steele et al created a more complete DateDiff:
http://www.accessmvp.com/djsteele/Diff2Dates.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Bonnie A said:
Hi everyone! Using A02 on XP.

I have rates to calculate frequently and have to calculate how many years
and months between two dates (day of the month isn't needed but I don't
mind
using it). I made a form with [StartDate] and [EndDate] and a Result
field
with this in the Control Source:

=DateDiff("d",[StartDate],[EndDate])

I can calc the number of days but need months and years (for example; 3
yrs,
5 mos and 18 days).

I've tried to play with it but it just errors. What is the proper form to
use for 'show it to me this way'?

Thank you in advance for any help or advice!
 

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