Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Min/Max valules for a duration formula Post Reply Post New Topic
Author Message
nhopp4
Groupie
Groupie


Joined: 03 Oct 2012
Location: United States
Online Status: Offline
Posts: 62
Quote nhopp4 Replybullet Topic: Min/Max valules for a duration formula
    Posted: 02 Nov 2012 at 4:55am
Hi Guys!
I need to create min/max value report.  I have created a duration formula but need to gather the Min and Max for the valules.  I am using these formulas for the duration formula:
 
DateTimeVar StartTime;
If {Reports_Events.Type} = 'start' then StartTime := {Reports_Events.Timestamp};
StartTime
 
If {Reports_Events.Type} = 'Stop' Then DateDiff('s',{Reports_Events.Timestamp}, {@startTime})
 
I have to calculate the minimum and maximum for each unit for the month of calls.  I can't figure out how to get this.  I tried using the Cross-Tab expert and selecting @duration and using Minimum, also maximum still not getting the right numbers.
 
Any help??  Thanks!
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Nov 2012 at 8:48am
if the problem arising is that the dates are sorting in a ASCII fashion, you can convert your dates to yyyy/MM/dd format, store the min and max in a set of shared variables, and then display them in the desired format.
 
it's an idea...
HTH
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 04 Nov 2012 at 7:34pm
Hi
--Create a group on Unit
--Create second group on Month
--Now insert Minimum({Reports_Events.Timestamp}) to get Minimum time at group level also insert Maximum({Reports_Events.Timestamp}) to get Maximum time at group level
 
 
 
 
 
Thanks,
Sastry
IP IP Logged
nhopp4
Groupie
Groupie


Joined: 03 Oct 2012
Location: United States
Online Status: Offline
Posts: 62
Quote nhopp4 Replybullet Posted: 05 Nov 2012 at 2:35am
Thanks guys for getting back to me.  Sastry I think that will work.  However, for each unit I am getting the same max for each unit.  Each of these should be different.
 
I used Maximum({@duration}) and Minimum({@duration}) because I need these to be in second format and not minimum time and maximum time.  Should be the minimum and maximum duration.
 
Thanks!
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.