Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Average Response Times Post Reply Post New Topic
Author Message
ranman
Newbie
Newbie


Joined: 09 Oct 2008
Location: United States
Online Status: Offline
Posts: 2
Quote ranman Replybullet Topic: Average Response Times
    Posted: 09 Oct 2008 at 7:22pm
I made a crystal report in Crystal  X1 with a time dispatched and arrival time.  What formula do I use to get the total difference between each time, and then a TOTAL average at the end of the page or report?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 13 Oct 2008 at 11:26am
Assuming that your fields are datetime fields, you can use the DateDiff and Average functions to help with this.
 
Create a formula that looks like this:
Average(DateDif('n', {table.DispatchTime}, {table.ArriveTime}))
 
This will give you the average number of minutes difference between the two times.
 
If you want to show this in hours and minutes, you'll need to create a second formula that references the first (which I'll call {@AveMinutes}):
 
ToText(({@AveMinutes}\60), 0) + ":" + ToText(({@AveMinutes}) mod 60), "00") 
 
Notice that I used a back-slash in the first calculation ('\' instead of '/').  This is the "Integer Divide" operator that gives you the integer part of the division result.
 
-Dell
 
IP IP Logged
ranman
Newbie
Newbie


Joined: 09 Oct 2008
Location: United States
Online Status: Offline
Posts: 2
Quote ranman Replybullet Posted: 07 Nov 2008 at 4:53pm
Thanks for the help.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.