Crystal 10
SQL database
I am creating a surgery turn-around-time report so I have to calculate the time between the stop of a case to start of next case. I need to create an avg TAT per OR_Room for each date in my report. My report is grouped by OR Room, Case_date, and sorted by start time.
I am getting the case-specific TAT with:
whileprintingrecords;
numbervar CaseTAT:=
if ({c_newor_cases.or_room}=previous{c_newor_cases.or_room})
and {@CaseDATE}=previous({@CaseDATE}))
then datediff("n",{@PrevStopDTime},{@StartDTime})
This part is working fine.
Then I set up a variable to give me a running total of the TATs:
whileprintingrecords;
numbervar RoomDateTAT:=RoomDateTAT+{@CaseTAT}
I reset @RoomDateTAT in Group2 (Date) header and this is working fine.
What I can't get to work is to get the sum or final subtotal into the group footer.
My data for 1 room for one day would be
CaseTAT RoomDateTAT
24 24
26 50
12 62
What I need is to get the 62 in the group 2 (date) footer. If I add it to the group 2 footer as is I get 74. It's adding the last CaseTAT to the subtotal again (62+12)
Can anyone tell me what I'm doing wrong>
SQL database
I am creating a surgery turn-around-time report so I have to calculate the time between the stop of a case to start of next case. I need to create an avg TAT per OR_Room for each date in my report. My report is grouped by OR Room, Case_date, and sorted by start time.
I am getting the case-specific TAT with:
whileprintingrecords;
numbervar CaseTAT:=
if ({c_newor_cases.or_room}=previous{c_newor_cases.or_room})
and {@CaseDATE}=previous({@CaseDATE}))
then datediff("n",{@PrevStopDTime},{@StartDTime})
This part is working fine.
Then I set up a variable to give me a running total of the TATs:
whileprintingrecords;
numbervar RoomDateTAT:=RoomDateTAT+{@CaseTAT}
I reset @RoomDateTAT in Group2 (Date) header and this is working fine.
What I can't get to work is to get the sum or final subtotal into the group footer.
My data for 1 room for one day would be
CaseTAT RoomDateTAT
24 24
26 50
12 62
What I need is to get the 62 in the group 2 (date) footer. If I add it to the group 2 footer as is I get 74. It's adding the last CaseTAT to the subtotal again (62+12)
Can anyone tell me what I'm doing wrong>