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

Working out Total Hours worked (Running over Mid Night) 1

Status
Not open for further replies.

scoombs

Technical User
Jan 31, 2005
11
GB
Hello.

I have a form and I enter in:

TimeIn
TimeOut

It is a night shift the database is for.

I need a field that will work out how many hours have been worked. Example Hours:

22:00 - 05:00

Look forward to someone's Solution.

Thanks,

Steve Coombs
 
IIf(TimeIn<=TimeOut, TimeOut-TimeIn, 24-TimeOut+TimeIn)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Good use of IIF.

I posted a less eloquent solution here...
Time Calculation

The only real difference is that the solution uses the DateDiff function.

Richard
 
Just discover a bug:
IIf(TimeIn<=TimeOut, TimeOut-TimeIn, 1-TimeOut+TimeIn)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top