OK, you can calculate a MinutesWorked field in the query:
MinutesWorked: DateDiff("n", IIf(Am_In < #8:00#, #8:00#,
Am_In), IIf(Pm_Out > #17:00#, #17:00#, Pm_Out))
The reason for using minutes instead of hours is so you can
deal with fractional hours. For example, if you want a
Pm_Out time of 4:45pm to be 7.75 hours, then divide the
minutes by 60. If you want the hours worked to be formatted
like 7:45, then use another expression (in a for or report
textbox) for displaying the formatted result:
=MinutesWorked \ 60 & Format(MinutesWorked Mod 60, "\:00")
--
Marsh
MVP [MS Access]
The purpose of converting the clock in/clock out time is to avoid over
calculation of the total hours worked. Because when an employee clocks in say
7:00AM, her/his total hours for the day would be 9 hours instead of only 8
hours.
I intend to use the procedure in my Timesheet Query and clock in/clock out
time is a Date/Time variable with no date part.
My tblTime has the following fields:
Time_ID (Autonumber)
Date (Date/Time) default value is Now()
Am_In (Date/Time) default value Time()
Pm_Out (Date/Time) default value Time()
Hope you could help me further on this and I really appreciate your efforts.
Thank you very much.