Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Average Time Elapsed between Min and Max Dates Post Reply Post New Topic
Author Message
Chipperoni
Newbie
Newbie
Avatar

Joined: 26 Feb 2013
Location: United States
Online Status: Offline
Posts: 2
Quote Chipperoni Replybullet Topic: Average Time Elapsed between Min and Max Dates
    Posted: 26 Feb 2013 at 10:33am

Hello!  Started using CR 10 with my new job a couple months ago and this forum has proven to be a great resource - so thanks in advance to all the helpful people on here.  It’s my turn to ask a question though as I’ve finally come across something that has thoroughly stumped me.

I’ll try not to indulge in too many details, but suffice to say I’m trying to get to a figure for average time elapsed between minimum and maximum dates.

The table I’m working with has a one to many relationship on ACCOUNTID and DATE_MODIFIED.  I’ve grouped on ACCOUNTID, and in my group footer I have minimum(DATE_MODIFIED, ACCOUNTID), maximum(DATE_MODIFIED, ACCOUNTID), and a datediff between the two.

I went to Insert -> Summary to calculate the average datediff in the report footer, but much to my chagrin realized CR will not allow a summary of a summary.  I’ve spent more time than I should have this afternoon trying to identify a workaround, but can’t find any examples on the interwebs that work as a solution in this specific situation.

Any advice would be greatly appreciated – I’d be more than happy to include any additional details as necessary.  

 



Edited by Chipperoni - 26 Feb 2013 at 10:43am
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 26 Feb 2013 at 7:21pm
Hi

Use below formula to arrive summary on summary :

Whileprintingrecords;  //Place this on group footer 1
numbervar diff:=diff+{diff_btwn_two_dates};


Whileprintingrecords;  // Place this on your report footer
Numbervar diff;

If you want to arrive average then create one more formula like

Whileprintingrecords;
Numbervar diff;

diff / {number of records}


Thanks,
Sastry
IP IP Logged
Chipperoni
Newbie
Newbie
Avatar

Joined: 26 Feb 2013
Location: United States
Online Status: Offline
Posts: 2
Quote Chipperoni Replybullet Posted: 27 Feb 2013 at 2:28am
This worked perfectly - thank you for your 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.014 seconds.