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

Man hour

Status
Not open for further replies.

Ced

MIS
Joined
Mar 25, 2002
Messages
3
Location
US
We have a fairly simple database on the form you must input a start date & time and ending date & time.

For example: start date 03/22/02 time 08:00 AM
ending date 03/23/02 time 5:00 PM

Would yield 18 or 16 hours depending if you count lunch.
We need access to calculate these hours
 
the Datediff function might do the trick.

wah
 
Hi there
Give this a go. It allows you to set the core hours.
'Store your core hours start and end times in two variables. Here they are CoreS and CoreF

CoreF = "17:00"
CoreS = "08:00"

CoreHours = DateDiff("h", CoreS, CoreF) - Lunch 'You can add the number of hours allocated to lunch per day

CoreDiff = DateDiff("h", CoreS, Stimestr) + DateDiff("h", Etimestr, CoreF)

'corediff checks to see whether the times entered are out of core hours. If the data is always the same, don't use it

Dresult = DateDiff("d", Sdatestr, Edatestr) + 1

ManHours = (Dresult * CoreHours) - CoreDiff

Let me know whether this is the solution..

N
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top