I am trying to find donors who gave this year but had not given for sometime, say 10 years. Anyone have any suggestions?
Constituent Query:
Criteria 1 - summary information - total amount greater than 0 - (filter on gift date 7/1/07-6/30/08 or whatever is "this year" to you)
AND Criteria 2 - summary information - total amount equals 0 (filter on gift date 7/1/96-6/30/07 or whatever is the 10 years before this year)
Unless you are looking for specific counts and totals, it slightly more efficient to place your criteria in the main query rather than in a summary function. If you don't care how many gifts nor how much they've given this year, put it in the main query. You do want to know a specific count of gifts in the previous ten years (zero), so you will need to use a summary function for that.
I would recommend the following criteria
Gift Amount > 0Gift Type one of {pick types}Gift Date between {your FY begin} and {your FY end}Total Count of Gifts = 0
Gift Type one of {pick the same types}
Gift Date between {previous range beginning} and {previous range end}
Making this change may not be noticeable when run once, but if you run this query frequently, the small increase will add up very quickly.
Drew
I'm a big fan of using Summary Information for queries like this - here's how I would tackle it:
Summary Information, Total Number of Gifts greater than or equal to 1, filtering on a Gift Date range equals (current year)AND Summary Information, Total Number of Gifts equals 0, filtering Gift Date between (your 10-year date range)AND Summary Information, Total Number of Gifts Greater than or equal to 1, filtering on Gift Date less than (the start date of your 10-year date range)
This way you will get everyone who gave this year and 10+ years ago without giving in the interim, but you would not include any first-time donors (unless you would like to include them, in which case you can eliminate the third line of criteria).
Thanks. It worked great.