newbie0423
IS-IT--Management
Hello,
I'm using Crystal XI
I'm writing a report that looks at the time a patient leaves the room until the time the next patient comes into the room (turnover time). Below are the formulas that I am using to get the average turnover time.
@average
WhilePrintingRecords;
Global NumberVar TotalHours;
Global NumberVar WorkOrderCount;
TotalHours / WorkOrderCount;
WorkOrderCount := WorkOrderCount + 1
@turnover
WhilePrintingRecords;
Global NumberVar TotalHours;
Global NumberVar WorkOrderCount;
Local NumberVar currentdiff;
if {@turnover} > 60 or {@turnover} = 0 then
currentdiff := 0
else
(
currentdiff := {@turnover};
TotalHours := TotalHours + currentdiff;
WorkOrderCount := WorkOrderCount + 1
);
currentdiff;
The average formula gets a division by zero error message. Could someone please tell me how to handle this error message
Thanks in advance
I'm using Crystal XI
I'm writing a report that looks at the time a patient leaves the room until the time the next patient comes into the room (turnover time). Below are the formulas that I am using to get the average turnover time.
@average
WhilePrintingRecords;
Global NumberVar TotalHours;
Global NumberVar WorkOrderCount;
TotalHours / WorkOrderCount;
WorkOrderCount := WorkOrderCount + 1
@turnover
WhilePrintingRecords;
Global NumberVar TotalHours;
Global NumberVar WorkOrderCount;
Local NumberVar currentdiff;
if {@turnover} > 60 or {@turnover} = 0 then
currentdiff := 0
else
(
currentdiff := {@turnover};
TotalHours := TotalHours + currentdiff;
WorkOrderCount := WorkOrderCount + 1
);
currentdiff;
The average formula gets a division by zero error message. Could someone please tell me how to handle this error message
Thanks in advance