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

date differences

Status
Not open for further replies.

nickbrookes

Technical User
May 12, 2001
20
0
0
GB
I've got two time values, and i want to calculate the difference between the two?

I'm obviously missing something, but i'm not sure what.

cheers
 
It seems like there would be a version of the DateDiff(interval, EndTime, StartTime) that does this in terms of hours or minutes. All I can find in the Access Help are interval codes for years, quarters, months, and days. And there does not seem to be a TimeDiff() function. So here is what I do for elapsed time in minutes -

Code:
elapsedTime = (Hour(EndTime)*60 + Minute(EndTime)) - (Hour(StartTime)*60 + Minute(StartTime))

This works pretty well unless the StartTime is today and the EndTime is tomorrow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top