Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateDiff Calculate Months and Days

Status
Not open for further replies.

Cloonalt

Programmer
Jan 4, 2003
354
US
This gives me the difference in days between two dates, but I want months and days, for example, 23 months, 2 days. Can I do this in a query? Any help appreciate.


DaysElapsed: DateDiff("d",[BeginDate],[EndDate])

Thanks
 
Hi,

Then YOU have to decide, how is a month calculated.

Is it the occurrence of any day in the range in a month (ie 2/28/2005 to 4/1/2005 could be 3 months under some definitions, 2 months in others and...???)

HOW MUCH is one month? 30 days? 365/12 days? 365.25/12 days?

Check out DateDiff("M", #2/28/2005#, #3/1/2005#)

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
Sounds too complicated. I think days will work. Thanks for your reply.
 

It's not necessarily that it's too complicated...

it's INEXACT!

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
SEarch these fora for "DOB". There are numerous calculations and variations on this theme, some of which will meet your stated requirements. On the other hand, if kipVought's suggestion really sound like too complicated, I doubt you'll be interestede in searching.





MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top