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

DateDiff to calc time difference?

Status
Not open for further replies.

Moonlady

Programmer
May 24, 2001
9
US
Hi All -- I am trying to use DateDiff to calculate the hours and minutes between TimeIn and TimeOut fields on a table and display the result on a form. The result does not need to be stored. I've tried several variations of DateDiff without success. Any suggestions would be greatly appreciated. X-)
 
DateDiff will only return ONE unit of the date/time process. To get a combination, you need to do multiple operations. The eneral approach is to do datediff with the smallest unit you want to display (e.g. Minutes in your case). Given the minutes, the hours are the minutes \ 60 (NOTE( the INTEGER division). then, the realMinutes = minutes - (Houors * 60)

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