Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Multiple date groups with use of "previous" Post Reply Post New Topic
Author Message
rybad80
Newbie
Newbie
Avatar

Joined: 18 Oct 2010
Location: United States
Online Status: Offline
Posts: 7
Quote rybad80 Replybullet Topic: Multiple date groups with use of "previous"
     Posted: 07 Sep 2011 at 4:19am

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!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 Sep 2011 at 7:26am

Are you looking for numbers by room?  If so, group on room and then on date.

-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum