TntConnect TM
Helping you build powerful connections for a lifetime of ministry...

How can I lookup all contacts who gave a certain number of gifts within a specific date range?: Revision #1

TNT.tips from Bob!

Table of Contents

It is our pleasure to provide this software free of charge to help you in your ministry.  We're so thankful for our partners who make this possible!

About TntWare

Page Details

First published by:
Troy Wolbrink
on 2 Dec 2009
Last revision by:
Troy Wolbrink
on 2 Dec 2009
1 person found this article useful.
You are currently reviewing an older revision of this page. Go to current version

How can I lookup all contacts who gave a certain number of gifts within a specific date range?

Filed under: ,

Custom lookups can be used to lookup about almost anything.  To lookup all the contacts who gave a certain number of gifts within a specific date range, you can use a custom lookup like this (requires TntMPD 2.1 r10 or newer):

SELECT Gift.ContactID
FROM Gift
WHERE (((Gift.[GiftDate])>=#1/1/2009#))
GROUP BY Gift.ContactID
HAVING COUNT(*) >= 5
ORDER BY COUNT(*) DESC

This lookup returns all the contacts who gave 5 gifts or more since 1/1/2009.

When you do this lookup, be sure to check the box "Custom Filter returns a list of Contact IDs".  If this box is not available, be sure you're running TntMPD 2.1 r10 or newer.

By way of another example, here's a custom lookup that returns all contacts who gave between 6 and 12 donations between 1/1/2009 and 12/31/2009:

SELECT Gift.ContactID
FROM Gift
WHERE ((Gift.GiftDate BETWEEN #1/1/2009# AND #12/31/2009#))
GROUP BY Gift.ContactID
HAVING COUNT(*) BETWEEN 6 AND 12
ORDER BY COUNT(*) DESC

© 2024 TntWare, Inc. | Privacy | Terms of Use