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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does a function exist to get difference of 2 dates ?

Status
Not open for further replies.

GAORR

Programmer
Nov 22, 2001
48
CA
Does anyone know if a function exists that will give the difference of 2 dates.

Thanks
 
Yup...
[tt]
Date3 = DateDiff("n", Date1, Date2)
[/tt]
That should work for ya.

By the way "n" is the interval for minutes. If you want days I think it's "D". But you can always check the help files for the exact syntax. Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
Yes, but you DO need to read the soc (help) carefully. DateDiff reports the "Boundary Crossings", which may (often) is not the 'expected' results, as in:

DateDiff("Y", #12/31/01#, #1/1/02#) yields 1, as in One Year!

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top