Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Help - Multiple Dates Post Reply Post New Topic
Author Message
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet Topic: Formula Help - Multiple Dates
     Posted: 07 Aug 2014 at 5:04am
I’m not sure if this is possible but any insight you have would be helpful.

I have 3 records in my database – as follows:

ID          Quantity     Pay Date
P121          100          6/1/2010
P122          100          1/1/2015
P123          100          1/1/2015

I’m using crystal to combine the quantities into a single line by summing them if the first 3 characters of the ID are the same. So, it looks like this on my report:

ID          Quantity     Pay Date
P12          300          

You’ll notice in my above data that the pay date varies by ID. I want the pay date on my report to always show the latest of the 3 dates. Right now, crystal randomly selects one of the 3 pay dates above when I insert the “Pay Date” field and run the report. I get either 6/1/2010 or 1/1/2015 - randomly.

Can I control the pay date field so it always gives me the latest field in my summed total?

Thanks,
Steve
ID
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 07 Aug 2014 at 5:59am
//EDIT//
Just to make sure, when you say latest, do you mean the date that is the later date in time, or the date that displays last in that group? In the date you provided it looks like you are grouped on date in ascending order, but I'm not sure if that is the case, which is why I'm asking.
//

Select the Pay Date field and click Insert Summary. Choose Maximum for the Calculate this summary option and add it to the appropriate Summary Location.


Edited by FrnhtGLI - 07 Aug 2014 at 6:01am
|< /\ '][' ( )
IP IP Logged
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet Posted: 07 Aug 2014 at 7:19am
This is great. Thank you very much.

To clarify - my goal was to display the maximum date so your solution is perfect.

Thanks again!

Steve
IP IP Logged
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