Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Ignoring Fields in Selected Records Post Reply Post New Topic
Author Message
Scamp
Newbie
Newbie
Avatar

Joined: 05 Jun 2008
Location: United States
Online Status: Offline
Posts: 14
Quote Scamp Replybullet Topic: Ignoring Fields in Selected Records
     Posted: 12 Nov 2008 at 5:09am
Hello all,
 
I am using Crystal 9. I am running a report that shows Schedule, Dispatch, and Complete times from our field tech ticketing system. The techs enter their times throughout the day to show their activity based on schedule, dispatch, and complete times for each task they complete. I am trying to find a way to calculate gaps in time between completion of one task and dispatch to the next. Please see example below. I need to find the difference between C1 and B2, C2 and B3, C3 and B4, and so on. This is grouped by day, so I need to ignore the first dispatch time (B1) and the last complete time (C6). The fields are date/time fields. Can someone let me know how this can be done (or if there is even a way to do it)? Any help would be much appreciated! Thanks!
 
Ron
 

 

ScheduleDateTime

DispatchDateTime

CompleteDateTime

11/3/2008

 

 

 

A

B

C

1

11/3/2008  1:23:00 PM

11/3/2008  7:30:00 AM

11/3/2008  9:00:00 AM

2

11/3/2008  11:38:00 AM

11/3/2008  9:00:00 AM

11/3/2008  10:10:00 AM

3

11/3/2008  1:23:00 PM

11/3/2008  10:10:00 AM

11/3/2008  2:20:00 PM

4

11/3/2008  3:47:00 PM

11/3/2008  2:20:00 PM

11/3/2008  3:00:00 PM

5

11/3/2008  1:23:00 PM

11/3/2008  3:00:00 PM

11/3/2008  3:30:00 PM

6

11/3/2008  5:00:00 PM

11/3/2008  3:49:00 PM

11/3/2008  3:49:00 PM

       
Ron
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Nov 2008 at 6:20am
Since each line is a different row shared variables and formulae are the way to go...I think.
 
Depends on where you want to see the difference, if diff of c2 and b3 are displayed on the b3 line, this should work, I don't know off-hand how to display on the c2 line.
 
In the detail section you will need to create a formula, and since this is running all the time I will use the 2nd line for the example, that first calculates the value of b2-c1 (datediff should work) and then captures (shared variable) the value of c2 for use the next time around.  You could even initialize the value of the variable to some bogus date and skip the calculation if the c value is that bogus date.
 
Hope this helps or at least provides a glimmer of an idea.
IP IP Logged
Scamp
Newbie
Newbie
Avatar

Joined: 05 Jun 2008
Location: United States
Online Status: Offline
Posts: 14
Quote Scamp Replybullet Posted: 18 Nov 2008 at 10:58am

Thanks for the help, however this is not working because I need to ignore the value in A1. Any ideas?

Ron
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Nov 2008 at 11:04am
for the formula add and if statement of:
if not OnFirstRecord then (
   existing formla
)
 
it's a thought.  this will ignore the first record...this would be for the display of the answer, you would still need to set the value to be used in the next line.
 
Hope it helps
IP IP Logged
Scamp
Newbie
Newbie
Avatar

Joined: 05 Jun 2008
Location: United States
Online Status: Offline
Posts: 14
Quote Scamp Replybullet Posted: 18 Nov 2008 at 11:45am

Thanks for the effort - unfortunately I need to ignore the first dispatch date value for each day (the report is grouped by day.) This has become a bit of a challenge, and I appreciate your help!

Ron
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Nov 2008 at 11:48am
There's bound to be a way....Hope you find it.
 
I think that I originally thought of a flag that would be set to, say '0' in the group header, and then in your formula say if flag=0, then skip the compare, but update the values and then set it the flag to '1'
 
Well, glad I could help, a little.
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