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!

Crytstal 2013

Status
Not open for further replies.

jchewsmith

Technical User
Nov 20, 2006
161
US
I have a start date, start hour and start minutes, then end date, end hour and end minutes that I need to calculate into total hours,minutes worked.

Start Date Start Hour Start Minute EndDate End Hour End Minute Result
4/1/16 8 00 4/1/16 16 15 8.25
4/2/16 8 30 4/2/16 13 00 5.5

Any suggestions on how to bring date time together then calculate total hours worked?


 
First off you would need a formula to do a date diff (datediff function) get the time difference (I think I would use minutes), then convert back tot hours minutes (several ways to do this). I think this still works
Replace the avgtime with your datediff value.
totext(truncate(avgtime/3600,0),0,"")+":"+totext(truncate(avgtime/60,0)-(truncate(avgtime/3600,0)*60),"00",0,"")
 
You can also concatenate the start dates and end dates with cdate function to convert to date then subtract based on what datediff you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top