Print Page | Close Window

Min/Max valules for a duration formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17909
Printed Date: 28 Apr 2024 at 12:35pm


Topic: Min/Max valules for a duration formula
Posted By: nhopp4
Subject: Min/Max valules for a duration formula
Date 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}, mailto:%7b@startTime - {@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!
 
 



Replies:
Posted By: lockwelle
Date 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


Posted By: Sastry
Date 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


Posted By: nhopp4
Date 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  mailto:%7b@duration - Maximum({@duration }) and Minimum( mailto:%7b@duration - {@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!



Print Page | Close Window