I think this should be pretty straight forward and yet can't seem to figure it out.
My report is designed pull time clock info into an understandable report for our payroll department. I have to separate vacation, personal, sick, regular and overtime from one another.
All hours are calculated per punch pair (2 punch pairs per day) in the punch.depthours column. There is a punch.nonworked column that indicates either "vac", "per" or "sic" and those hours are also stored in the punch.depthours column.
I have the following formulas set up:
//VACATION-extracts only vacation hours
IF {PUNCH.NONWORKED} = "Vac"
THEN
{PUNCH.DEPT HOURS}
I have the same formula set up for "Per" and "Sic"
The Regular hours CANNOT include any vacation, personal or sick time. I have the following formula:
//Regular-extracts all hours that are worked
if isnull ({PUNCH.NONWORKED})
then {PUNCH.DEPT HOURS}
Anything over 80 hours is considered overtime. So for my OT formula:
if sum({PUNCH.DEPT HOURS},{PUNCH.EMPLOYEE ID})> 80.00
then sum({PUNCH.DEPT HOURS},{PUNCH.EMPLOYEE ID}) - 80.00
else 0
PROBLEM:
My Regular hours formula is including time that should be paid as OT, because of how it reads it's not taking out what's been extracted as OT....confusing?
example: Mary works a total of 82.50 hours. 8 of those hours were vacation hours and 2.5 hours of OT. So my report should read:
REG OT Vac Total Hours
72.00 2.50 8.00 82.50
the way my formulas are written produces:
REG OT Vac Total Hours
74.50 2.50 8.00 85.00
Anyway of extracting the OT out of the REG - Any help would be greatly appreciated!!