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

Help!!!!!Calculating #$%$#^%timeStart on one date end on next day?????

Status
Not open for further replies.

DaveMac

Technical User
Apr 9, 2000
161
US
I am trying to do time cards.  I have a third shift and they start on say the 11th at 2300 hrs and end on the 12th at 0700 hrs.  Thats 8 hrs right ?????? You would think I should know this but nooooooooo.  I have a date field and a separate time field so if that help please shine the light.
 
All you need are 2 date fields, no separate time fields.&nbsp;&nbsp;End Time minus Start Time (the date fields) gives you the difference...format it as time only:<br>result time = format(endtime - starttime,&quot;hh:nn:ss&quot;)<br>if you are dealing with greater than 24 hours, you'll need to parse out the date portion to the left of the decimal, and multiply by 24<br>--Jim
 
Also, check out function DateDiff, which returns the time between two dates/times in a specified unit. <p> Jonathan<br><a href=mailto:j.w.george@virginnet.co.uk>j.w.george@virginnet.co.uk</a><br><a href= > </a><br>Working with: Visual Basic 6, Access 97, Visual Interdev 6, VBScript, Active Server Pages, SQL Server 6.5, Oracle 7, users who really have no idea what they want...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top