Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group Selections with Dates Post Reply Post New Topic
Author Message
andyp
Newbie
Newbie
Avatar

Joined: 20 Sep 2010
Location: Germany
Online Status: Offline
Posts: 19
Quote andyp Replybullet Topic: Group Selections with Dates
    Posted: 10 Jul 2012 at 10:55am
I thought I was ok with groups, until now....
I have table entries as seen below and each entry also has a renewal date field saved along side it so I can take renewal action etc.
 
Type                      Renewal Date
 
Inspection 1          31.12.2009
Inspection 2          31.12.2010
Inspection 3          31.12.2014
Final Inspection     31.12.2014
 
I have various check reports that work well but even if Inspection 3 has a future date I do not want to see it appear in my check list if the field Final Inspection also has a future date (even if less than Inspection 3 date). I must pick entries by date in my reports. I guess I am looking for a way to produce a group selection formula that will not pick up a record with the Inspection 1-3 entry (even if one of then has a date greater than todays date) where the Final Inspection Renewal date is greater than todays date.
 
Any assistance much appreciated!!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jul 2012 at 12:17pm
you can use group summary data as a group select criteria
you can create formulas to convert your data into useable group level info and then use that in the select criteria
 
eg formula: F_I_flag
if type='final inspection' and date>today then 1 else 0
sum this at the group level
now you have a flag you can use
sum(@F_I_flag,group)>0
IP IP Logged
andyp
Newbie
Newbie
Avatar

Joined: 20 Sep 2010
Location: Germany
Online Status: Offline
Posts: 19
Quote andyp Replybullet Posted: 11 Jul 2012 at 10:30am
 
Thanks DBlank, a really useful formula. I noticed I still have a bit of a problem though with a point I had not previously considered.
 
The report only shows a final inspection date greater than todays date (thanks to your formula).
 
If the date against Inspection (1 to 3) is greater than todays date it shows this as well against a record (it shows both).
 
If a Final Inspection date exists that is newer than an Inspection 1 - 3 date I need it to only list the Final Inspection date. It should not include an inspection 1-3 entry as well.
 
any ideas would be much appreciated!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Jul 2012 at 11:21am
not sure I exactly fllow but you can create a formula to get a max value for final inspection only
//insepect_date
if type='final inspection' then renaldate else date(1900,1,1)
insert a max of this at your group level
maximum(@inspect_date,group)
 
now you can suppress your other rows based on this value
 
 


Edited by DBlank - 11 Jul 2012 at 11:22am
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.015 seconds.