Question here....
I am trying to write a report to figure out some average times between cases in the Opertaing Room. This table of cases consists of one case after another and really doesn't know if case 2 was after case 1 in room 1 or if it was in room 2. This is where the "previous" logic comes in.
First off, I'm sorted by date of OR case and then use
if {POST_CASE.CASE_NO} <> previous({POST_CASE.CASE_NO}) and
{POST_CASE.ROOM_ID} = previous({POST_CASE.ROOM_ID})
and previous({POST_CASE.ENTER_PROC_ROOM_TIME}) <> DATETIME(1800, 01, 01, 00, 00, 00) and
previous({POST_CASE.ENTER_PROC_ROOM_DATE}) = {POST_CASE.ENTER_PROC_ROOM_DATE}
then
(time({POST_CASE.ENTER_PROC_ROOM_TIME})-time(previous({POST_CASE.LEAVE_PROC_ROOM_TIME})))
else 0
This allows me to only calculate the times between 2 cases on the same day in the same room, and this is working just fine. Where my question comes in is now I'd like to total all of these times and re-group on week or month. Therein lies the problem. I can get my totals just using a straightforward start and end date but when I try to group the totals by week or month it resorts the data, this rendering the "previous" syntax useless.
Any thoughts?
Thanks!