Time calculation problems

  • Thread starter Thread starter Glenn Cornish
  • Start date Start date
G

Glenn Cornish

I am trying to get a result that will show me the difference, in hours and
minutes, between two times. The application is on a staffing roster, and
what i want to be able to do is calculate working hours in the day, so
difference between start time and finish time less a predetermined amount
for lunch breaks (1/2 hour). So if someone starts at 9am and finishes at
5pm, i need the result to be 7 1/2 hours.

I have been unable to find a solution to this, so any help would be greatly
appreciated

glenn
 
Create a query into this table.

Type a calculated field into the Field row of query design:
Hours: (DateDiff("n", [StartTime], [FinishTime]) - 30) / 60
 
I am trying to get a result that will show me the difference, in hours and
minutes, between two times. The application is on a staffing roster, and
what i want to be able to do is calculate working hours in the day, so
difference between start time and finish time less a predetermined amount
for lunch breaks (1/2 hour). So if someone starts at 9am and finishes at
5pm, i need the result to be 7 1/2 hours.

I have been unable to find a solution to this, so any help would be greatly
appreciated

Depending on the precision of the value, you can use the DateDiff()
function:

DateDiff("n", [StartTime], [FinishTime]) - 30

will give the number of minutes less lunch. Divide this expression by
60 and round to one decimal place to get hours and tenths:

Round((DateDiff("n", [StartTime], [FinishTime]) - 30) / 60., 1)
 
Back
Top