I have created a report that determines room turnover times by room and then displays the data on a report. I would like to now generate an average for each room of these "turnover" times but since they are formulas with calculated field I am running into a problem. Anyone doing anything like this, here is a sample of the formula that I am using for the turnover times :
IF {case_record.room_mnc} = Previous ({case_record.room_mnc}) and
{case_record.cr_prdate} = Previous ({case_record.cr_prdate})
THEN
IF {v_CRA_OR_Patient_Times.time_pat_in_room} >= Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room})
Then ((Truncate( {v_CRA_OR_Patient_Times.time_pat_in_room} /100)*60)+
(ToNumber(Right(ToText( {v_CRA_OR_Patient_Times.time_pat_in_room}/100),2))))-
((Truncate( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100)*60)+
(ToNumber(Right(ToText( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100),2))))
ELSE
(1440 - (Truncate( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100)*60+
ToNumber(Right(ToText(( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100)),2)))) +
(Truncate( {v_CRA_OR_Patient_Times.time_pat_in_room} /100)*60 +
ToNumber(Right(ToText(( {v_CRA_OR_Patient_Times.time_pat_in_room} /100)),2)))
ELSE
0
IF {case_record.room_mnc} = Previous ({case_record.room_mnc}) and
{case_record.cr_prdate} = Previous ({case_record.cr_prdate})
THEN
IF {v_CRA_OR_Patient_Times.time_pat_in_room} >= Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room})
Then ((Truncate( {v_CRA_OR_Patient_Times.time_pat_in_room} /100)*60)+
(ToNumber(Right(ToText( {v_CRA_OR_Patient_Times.time_pat_in_room}/100),2))))-
((Truncate( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100)*60)+
(ToNumber(Right(ToText( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100),2))))
ELSE
(1440 - (Truncate( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100)*60+
ToNumber(Right(ToText(( Previous ({v_CRA_Intraop_Drsg_ESU_Plate_Site.time_pat_out_of_room}) /100)),2)))) +
(Truncate( {v_CRA_OR_Patient_Times.time_pat_in_room} /100)*60 +
ToNumber(Right(ToText(( {v_CRA_OR_Patient_Times.time_pat_in_room} /100)),2)))
ELSE
0