Years, Months, Days

1. its
Senior Member
Join Date
Dec 1969
Posts
238

## Years, Months, Days

i am trying to get the Number of Years, Months, and Days between two years like 01/04/1974 and today(07/09/2003). <BR>I have these options to get them.<BR>Here "SvDt" is 01/04/1974 ---<BR><BR>Mo = DateDiff("m", Date, SvDt) <BR>YRRR = DateDiff("yyyy", Date, SvDt) <BR>Da = DateDiff("d", Date, SvDt)<BR><BR>Using this one i am getting Years and Months<BR>Duration = (Right(mo 12,2)*12) + (ABS(Right(mo MOD 12,2)))<BR><BR>But Just confused about how to get the number of Days... <BR>Help me...<BR><BR>

2. Senior Member
Join Date
Dec 1969
Posts
11,247

## RE: Years, Months, Days

You need to rethink your problem.<BR><BR>Number of years and months are *not* easy to calculate <BR><BR>leap years -- ?<BR>Months do not have the same number of days in them!<BR>

3. Senior Member
Join Date
Dec 1969
Posts
273

## RE: Years, Months, Days

You should be able to do this working with dates and integers without too much trouble. This might need a bit of tweaking, but it should point you in the correct direction...<BR><BR>dtDate = DateSerial(1974,4,1)<BR>iYears = DateDiff("yyyy", dtDate, Date())<BR>dtDate = DateAdd("yyyy", iYears, dtDate)<BR>iMonths = DateDiff("m", dtDate, Date())<BR>dtDate = DateAdd("m", iMonths, dtDate)<BR>iDays = DateDiff("d", dtDate, Date())<BR><BR>Gavin

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•