Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Avg ring time grouped by each Co. format hr:mm:ss Post Reply Post New Topic
Author Message
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Topic: Avg ring time grouped by each Co. format hr:mm:ss
    Posted: 08 Dec 2011 at 8:48am
Hello everyone,
 
I have the following formula:
 
Local NumberVar myHours;
Local NumberVar myMinutes;
Local NumberVar mySeconds;
mySeconds := Average ({queue_performance_all.RingTime}, {queue_performance_all.CallDateTime}, "daily");
myHours := mySeconds \ 3600;
mySeconds := mySeconds mod 3600;
myMinutes := mySeconds \ 60;
mySeconds := mySeconds mod 60;
ToText(myHours,0) & ":" & ToText(myMinutes,0) & ":" & ToText(mySeconds,0)
 
This works fine except I need the formula to change when there is a name change.  I've tried the following:
 
Local NumberVar myHours;
Local NumberVar myMinutes;
Local NumberVar mySeconds;
mySeconds := Average ({queue_performance_all.RingTime}, {queue_performance_all.CallDateTime}, "{queue_performance_all.QueueName}");
myHours := mySeconds \ 3600;
mySeconds := mySeconds mod 3600;
myMinutes := mySeconds \ 60;
mySeconds := mySeconds mod 60;
ToText(myHours,0) & ":" & ToText(myMinutes,0) & ":" & ToText(mySeconds,0)
 
The end result would be the following:
 
Company A             00:00:10
Company B             00:00:23
 
I'm trying to get the average ring time grouped by each company in the hr:mm:ss format.  Any ideas?
 
Thank you in advance.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 08 Dec 2011 at 9:15am
the math looks correct, I am guessing that you don't like the format of toText...
 
not to fear, try toText(myHours, "00" 0, "")
 
this should work, haven't needed this layout before, but it what CR help states.
IP IP Logged
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Posted: 09 Dec 2011 at 4:47am
Thank you.  You are the best.  Smile
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.027 seconds.