Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Query Question Post Reply Post New Topic
Author Message
vgillis
Newbie
Newbie


Joined: 05 Mar 2013
Online Status: Offline
Posts: 10
Quote vgillis Replybullet Topic: Query Question
     Posted: 17 Apr 2013 at 3:54am
Hi all
I have a question. I have a table called AA_GIFT_DETAIL.

ID
Gift_no
Gift_Amt
Gift_date

I want to find all new donors within the last year. So the minimum gift date would have to be between a specified time frame.

I am lost. Any ideas would be helpful.

Thanks
Veronica
IP IP Logged
joeg1962
Newbie
Newbie


Joined: 01 Mar 2013
Location: United States
Online Status: Offline
Posts: 35
Quote joeg1962 Replybullet Posted: 17 Apr 2013 at 5:04am
Perhaps with logic something like:
{@Gift_Date} >= DateAdd('m',-12,Today)
to find donation dates within past 12 months
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Apr 2013 at 5:32am
I think you will need to use group select option
 

group on donor (ID)

insert a summary as a minimum of giftdate at the donor group
use group select statement to exclude all groups where the min date is more than a year ago
minimum(gift_date,ID)>=dateadd('yyyy',-1,currentdate)
 
or you can use a command object or stored procedure to limit the data set before you get it into the report
 
Note: group select criteria will leave all group names in the group tree and all of the summarys will include all data. RTs or variable formula calculations will exclude the filtered group data
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