JonathanNYC
IS-IT--Management
Several of you helped me with a formula to calculate time used in the OR only up to 7 p.m. There are instances when a case starts before 7 PM and ends after 7 PM and that calculation is accurate.
However, there are a few instances each month when a case starts AFTER 7PM. As such, it seems that I require one further tweak in my formula (see existing formulas below) because I am getting some negative numbers (e.g., case starts at 19:30 hours and my results are displaying -0.50). I understand that .50 is 30 minutes, but I want a result of 0:00 minutes (or no value).
Is there a way I can modify the formula so that 0:00 minutes are displayed (or no value is displayed) for any case that starts AFTER 19:00 hours?
Upto7PM formula:
datetimevar Mytime:={pcmOpTime.timePatientLeaveRoom};
timevar MaxTime:= time(19,0,0);
if time(MyTime) > MaxTime then
MyTime:=date(Mytime)+MaxTime;
MyTime
My Time formula:
evaluateafter({@upto7pm});
datetimevar MyTime;
datediff("n",{pcmOpTime.startSetup},MyTime)/60
I am using Crystal Reports 10.0.
Jonathan
However, there are a few instances each month when a case starts AFTER 7PM. As such, it seems that I require one further tweak in my formula (see existing formulas below) because I am getting some negative numbers (e.g., case starts at 19:30 hours and my results are displaying -0.50). I understand that .50 is 30 minutes, but I want a result of 0:00 minutes (or no value).
Is there a way I can modify the formula so that 0:00 minutes are displayed (or no value is displayed) for any case that starts AFTER 19:00 hours?
Upto7PM formula:
datetimevar Mytime:={pcmOpTime.timePatientLeaveRoom};
timevar MaxTime:= time(19,0,0);
if time(MyTime) > MaxTime then
MyTime:=date(Mytime)+MaxTime;
MyTime
My Time formula:
evaluateafter({@upto7pm});
datetimevar MyTime;
datediff("n",{pcmOpTime.startSetup},MyTime)/60
I am using Crystal Reports 10.0.
Jonathan