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!

Need way to calculate time worked in a day minus lunch break 1

Status
Not open for further replies.

xwizardx

Programmer
Oct 13, 2005
16
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
 
Typically you would not store a value that can be calculated. If you really think you need to store a value that can be calculated on the fly then try something like the following to get the minutes:
Code:
=DateDiff("n",TimeIn, LunchOut) + DateDiff("n",LunchBack, TimeOut)
or
Code:
=DateDiff("n",TimeIn, TimeOut) - DateDiff("n",LunchOut, LunchBack)

This assumes all fields will have values

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top