crystalnewbie
MIS
I'm creating an employee labor report that calculates the amount of break time they took and if they took enough time for their break.
The data coming in from the db is as follows:
empid, workdate, punchIn, punchOut, startReason, endReason
100,3/1/04,3:00pm,6:00pm,newShift,out
100,3/1/04,6:30pm,7:30pm,mealbreak,out
With the above data, the mealbreak actually started at 6pm and ended on 6:30pm for a total time of 30min.
I've created variables to capture the mealbreak start time and end time.
//@startbreak
whileprintingrecords;
if {tblname.startReason} = "newShift" then {tblname.punchOut}
//@endbreak
whileprintingrecords;
if {tblname.startReason} <> "newShift" then {tblname.punchIn}
I've grouped the data by empid, and placed the both formula on the detail section. The @startbreak is ending up as blank once it hit the second record for the same employee.
How do I retain the initial value of @startbreak?
The data coming in from the db is as follows:
empid, workdate, punchIn, punchOut, startReason, endReason
100,3/1/04,3:00pm,6:00pm,newShift,out
100,3/1/04,6:30pm,7:30pm,mealbreak,out
With the above data, the mealbreak actually started at 6pm and ended on 6:30pm for a total time of 30min.
I've created variables to capture the mealbreak start time and end time.
//@startbreak
whileprintingrecords;
if {tblname.startReason} = "newShift" then {tblname.punchOut}
//@endbreak
whileprintingrecords;
if {tblname.startReason} <> "newShift" then {tblname.punchIn}
I've grouped the data by empid, and placed the both formula on the detail section. The @startbreak is ending up as blank once it hit the second record for the same employee.
How do I retain the initial value of @startbreak?