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

How to calculate time spent from two dates

Status
Not open for further replies.

JSeidel

Technical User
Jan 10, 2003
77
US
I am trying to create a "how many minutes field" from two time fields. One being "time start" and the other "time at end" . How do I calculate the "total time from start to end" ?

thanks!
 
Can you supply an example of the format the time is stored in?

Are these datetimes, or?

There's the datediff('n', {MyDatefield1}, {MyDatefield2}) which would return a time difference between two datetime fields, and then there's the Time function, which when subtracted returns time in seconds as in:

((time(DateTime(1996, 1, 1, 12, 10, 10) )-time(DateTime(1996, 1, 1, 12, 9, 10))))/60

returns 1

-k kai@informeddatadecisions.com
 
I can work with either the data model datetime or I also have a time field I got from separating the data model datetime
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top