Givers Over Amount Report¶
This SQL script will look for any donors who have given more than the amount specified in the script during the current calendar year to date. If couples give jointly, only the HOH will be listed in the report. This report is protect by the user role Finance. After you run the report for the first time, you can opt to Add to Menu. If you click on that link, this report will be listed under Reports in the Main Menu. As with all of our SQL Scripts, you can download as Excel.
Copy the code below and paste it into your database after creating the New Sql Script. We suggest naming it GiversOverAmount.
For this sample report with test data, we used the amount of $10,000 in the script. The code below has $20,000 as the amount. You can make it whatever amount you want.
--Roles=Finance IF LEN(@p1) = 0 SET @p1 = CONVERT(VARCHAR, DATEPART(yyyy, GETDATE())) SELECT PeopleId, Amount, Name, PrimaryAddress, PrimaryAddress2, PrimaryCity, PrimaryState, PrimaryZip FROM dbo.People p JOIN ( SELECT CreditGiverId, SUM(Amount) Amount FROM Contributions2('1/1/' + @p1, '12/31/' + @p1, 0, 0, NULL, 0, NULL) GROUP BY CreditGiverId ) tt ON tt.CreditGiverId = p.PeopleId WHERE tt.Amount > 20000 ORDER by 'Amount'