Jezzamatez
Technical User
Hi, I have a counter for how many consecutive shifts someone has worked and I'm trying to get the date of the first shift of the consecutive period by using the counter to go back through each record.
I'm guessing for each iteration of the loop it's assigning the same previous value to the variable instead of going back through x number of records.
Can anyone offer any suggestions?
whileprintingrecords;
numbervar ShiftCnt;
Numbervar i;
Datevar Start:={@Shift Date};
If {@ST&LC Combination} = previous({@ST&LC Combination})
and {@Weekending} <= previous({@Weekending}) + 7
then ShiftCnt:=ShiftCnt+1 else
ShiftCnt:=1;
For i:= 1 To ShiftCnt Do (Start:=Previous({@Shift Date}));
I'm guessing for each iteration of the loop it's assigning the same previous value to the variable instead of going back through x number of records.
Can anyone offer any suggestions?
whileprintingrecords;
numbervar ShiftCnt;
Numbervar i;
Datevar Start:={@Shift Date};
If {@ST&LC Combination} = previous({@ST&LC Combination})
and {@Weekending} <= previous({@Weekending}) + 7
then ShiftCnt:=ShiftCnt+1 else
ShiftCnt:=1;
For i:= 1 To ShiftCnt Do (Start:=Previous({@Shift Date}));