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

Calculate Hrs and min worked, minus lunch break

Status
Not open for further replies.

xwizardx

Programmer
Oct 13, 2005
16
0
0
US
CONSIDER:

four fields:
[TimeIn] = 8:30
[TimeOut] = 16:00
[LunchOut] = 12:30
[LunchBack] = 13:15

The times will vary with the record being processed.

Is there a function or procedure that I can use to fill a 5th field: [TotalTimeWorked]?

Thanks

Barry Davis, President
Small Business Computing, LLC
 
A starting point:
[TimeOut] - [TimeIn] + [LunchBack] - [LunchOut]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You might want to store your times as date/times; this stops your application falling over if anyone ever works past midnight...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top