Querying for "inactive" donors

K

K. Georgiadis

I have in front of me a large data base for a charitable
organization, organized in two tables: 1) personal
information of supporters/donors and 2) donations by each
donor, showing date of each check, amount and designated
use of funds.

I need to query the data base for those donors who have
NOT written any checks since January 1, 2001.

Can someone tell me how to do that?

Thanks in advance.

KG
 
D

Dirk Goldgar

K. Georgiadis said:
I have in front of me a large data base for a charitable
organization, organized in two tables: 1) personal
information of supporters/donors and 2) donations by each
donor, showing date of each check, amount and designated
use of funds.

I need to query the data base for those donors who have
NOT written any checks since January 1, 2001.

Can someone tell me how to do that?

Without the table deals I can't be precise, but a query with SQL along
these lines should so the job:

SELECT * FROM Donors
WHERE NOT EXISTS
(SELECT DonorID FROM Donations
WHERE Donations.DonorID = Donors.DonorID
AND DonationDate >= #1/1/2001#);
 
J

John Vinson

I have in front of me a large data base for a charitable
organization, organized in two tables: 1) personal
information of supporters/donors and 2) donations by each
donor, showing date of each check, amount and designated
use of funds.

I need to query the data base for those donors who have
NOT written any checks since January 1, 2001.

A Subquery will do this:

SELECT <some fields>
FROM Donors
WHERE NOT EXISTS
(SELECT DonorID FROM Donations
WHERE Donations.DonorID = Donors.DonorID
AND DonationDate > #1/1/2001#)

For more flexibility, if you want all donors who haven't donated in
the past three years say, use a criterion of

DateSerial(Year(Date() - 2, 1, 1)
 
D

Dirk Goldgar

SELECT <some fields>
FROM Donors
WHERE NOT EXISTS
(SELECT DonorID FROM Donations
WHERE Donations.DonorID = Donors.DonorID
AND DonationDate > #1/1/2001#)

LOL - You picked the same example names as I did!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top