Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Calculate Time on a single field Post Reply Post New Topic
Author Message
mpalecek
Newbie
Newbie
Avatar

Joined: 28 Feb 2008
Location: United States
Online Status: Offline
Posts: 9
Quote mpalecek Replybullet Topic: Calculate Time on a single field
     Posted: 28 Feb 2008 at 9:48am
I am trying to write a report that describes the efficency of a process. I have a single field that stores the date/time of a bar code scan.
 
I would like to be able to calculate how long between scans and then use that number to graph an "Efficency".
 
Does anyone know how I would accomplish this?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Feb 2008 at 12:04pm
If you set up your data groups and sorts so that the scans are consecutive, you should be able to compare the field in the current record vs the previous record using the Previous() function.
 
-Dell
IP IP Logged
mpalecek
Newbie
Newbie
Avatar

Joined: 28 Feb 2008
Location: United States
Online Status: Offline
Posts: 9
Quote mpalecek Replybullet Posted: 28 Feb 2008 at 1:47pm
Thanks, that worked out well, but now the next step in my report is not working. The reason I wanted this was to find the amount of time that passes between two scans.
 
Now that I have that I want to calculate averages for each day and week. However, i cannot summarize the field with Previous() function in it. Any ideas?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Feb 2008 at 2:42pm
You'll probably have to use shared variables to calculate the running total and the item count and then just divide them.
 
-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