I need to perform a time sheet calculations Employee will punch in and punch out. I store those records in one table. That table has time and a field for in punch or out punch. Employee may go out for lunch or other reasons and punches for out and in. I need to deduct those times and get the working hours. My table will look like below :
PunchTime EmpCode IsInpunch
10:01 AM (A) T
12:03 PM (A) F (this isoutpunch)
01:05 PM (A) T
07:14 PM (A) F
10:32 AM (B) T
For (A)’s time 7.14 – 10.01 is the total hours, but he was not there between 12.03 to 01.05 so I need to deduct the lunch time and get the total hours. How to do this in Query
This is pretty straightforward. Assuming your T and F IsInPunch is balanced, which is to say for any day, you will have T-F or T-F-T-F etc (always paired), just total up the F and subtract the total of T’s.
(haven’t got Access open but do check the syntax)