Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Thanks in advance for help!
I'm trying to write an expression where I'm checking a Scheduled start time (SCHED_START_TIME) vs. patient in the room time (PiR_DATE_TIME); if the latter is later, I would get the difference of the times in minutes, otherwise, it would be 0.
The expression I have below is not working - I get an error in calculation (have tried several variations to no luck)
if(time(frac(SCHED_START_TIME)) > time(frac(PiR_DATE_TIME)), time(frac(SCHED_START_TIME) - time(frac(PIR_DATE_TIME), 0)
(I would add an "AND" comparing end times as well).
The current "In Block" is good but the "Out Block" isn't always correct in the application so am trying to overwrite it.
THE Sched Start | THE Sched Stop | Pt In Rm | Pt Out Rm | Duration | Tot Sched Block | In Block | Out Block |
330 | 40 | ||||||
11/07/2014 08:00 | 11/07/2014 11:00 | 11/07/2014 08:00 | 11/07/2014 09:54 | 114 | 240 | 114 | 0 |
11/21/2014 08:00 | 11/21/2014 10:30 | 11/21/2014 07:57 | 11/21/2014 10:19 | 142 | 240 | 139 | 3 |
11/21/2014 10:30 | 11/21/2014 12:50 | 11/21/2014 10:43 | 11/21/2014 12:37 | 114 | 240 | 77 | 37 |
Are you sure all your fields are loaded as Timestamps? Put them in listboxes and change the Number format to Fixed to 4 places. Do they all look like decimal numbers eg 40234.02567?
-Rob
Karen,
How did you get the duration in minutes, the difference between 2 timestamp in minutes?
Would be interesting to know!
One day = 1. You can multiply the difference by 1440 (the number of minutes per day) or my preferred method, use the Interval function.
Interval(myduration, 'm')
so
Interval(0.5, 'm') = 720
-Rob
Thank you for that clear explanation, Rob!
I saw you also used the rangemax function, was that to be able to count null() values included in the interval range?
The RangeMax function was used in the original thread because the OP had some missing data and wanted to ensure the duration was never less than zero -- which would have been invalid in this case.
-Rob