on 06-08-2018 8:30 PM
I have a report where I am getting the total minutes for a group of patients based on order date and transfer date using a formula called @TimeDiff: datediff("n",{Order_Proc.Order_Time},{Clarity_Adt.Effective_Time}), I then created another formula to sum up the minutes called @SumMin: sum({@TimeDiff}). I can get an AVG IN Minutes but I want an AVG in HOURS and MINUTES. So if I have 4 patients and the total minutes for these 4 patients is 255 minutes the avg in minutes is 63.75. How do I get that in Hours and Minutes ? Thanks.
Hi Curt,
1. Modify the TimeDiff formula so it returns value in seconds:
datediff("s",{Order_Proc.Order_Time},{Clarity_Adt.Effective_Time})
2. Create a formula with this code to display the Avg in HH:MM:
Numbervar s := SUM({@TimeDiff})/DistinctCount({PatientNumber});
NumberVar Hours := Truncate (s/3600);
NumberVar Minutes := Truncate (Remainder (s,3600)/60);
NumberVar Seconds := Remainder (s,60) ;
Totext (Hours,0,"") + ':'+ Totext (Minutes,0,"");
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.