Good afternoon,
This will probably go without saying after reading the post but I'm new to formula writing...
I am currently trying to provide a report that details ambulance transport times and then calculates average times for all transports.
Transport times are calculated by determining the difference between the time they call "en route" and the time they call "arrived". We use the codes "EH" and "AH" in the system to generate time stamps for each event. The codes are not always entered consecutively and because of that, I had to use the following formula to make sure the calculation worked correctly:
numberVar dur:=
DateDiff("s",minimum({rlmain.logdate},{cdcall.number}), maximum({rlmain.logdate},{cdcall.number}));
numberVar Hrs;
NumberVar Min;
NumberVar Sec;
StringVar HHMMSS;
Hrs:= Truncate(Truncate (dur/60)/60);
Min:= Remainder(Truncate(dur/60),60);
Sec:= Remainder(dur,60);
HHMMSS:= totext(Hrs,"0") + ":" + totext(Min,"00") + ":" + totext(Sec,"00");
HHMMSS
At the end of the report, I tried to get the average of these times by using this formula in the "Average Response Time Field":
Average ({@Elapsed Time})
where "Elapsed Time" is the calculated transport time from the formula above.
The problem is that I am getting an error in the formula that says "A number field or Currency Amount Field is required here"
Is there a better method to generate the transport times and if not, how might I avoid the error in the "Average Response Time" field.
Thanks,
Matt
This will probably go without saying after reading the post but I'm new to formula writing...
I am currently trying to provide a report that details ambulance transport times and then calculates average times for all transports.
Transport times are calculated by determining the difference between the time they call "en route" and the time they call "arrived". We use the codes "EH" and "AH" in the system to generate time stamps for each event. The codes are not always entered consecutively and because of that, I had to use the following formula to make sure the calculation worked correctly:
numberVar dur:=
DateDiff("s",minimum({rlmain.logdate},{cdcall.number}), maximum({rlmain.logdate},{cdcall.number}));
numberVar Hrs;
NumberVar Min;
NumberVar Sec;
StringVar HHMMSS;
Hrs:= Truncate(Truncate (dur/60)/60);
Min:= Remainder(Truncate(dur/60),60);
Sec:= Remainder(dur,60);
HHMMSS:= totext(Hrs,"0") + ":" + totext(Min,"00") + ":" + totext(Sec,"00");
HHMMSS
At the end of the report, I tried to get the average of these times by using this formula in the "Average Response Time Field":
Average ({@Elapsed Time})
where "Elapsed Time" is the calculated transport time from the formula above.
The problem is that I am getting an error in the formula that says "A number field or Currency Amount Field is required here"
Is there a better method to generate the transport times and if not, how might I avoid the error in the "Average Response Time" field.
Thanks,
Matt