Selecting records based on most recent entry.

KACJR

Registered User.
Local time
Today, 09:21
Joined
Jul 26, 2012
Messages
98
Greetings to the well of knowledge...

My people table consists of a primary key (person's name), address information, etc. My donors table consists of a primary key consisting of the person's name and an auto-increment field for each donation made by the person (for unique key purposes only), the date of the donation, reason, and amount of the donation.

My boss has asked me to identify the date of the last donation made by each donor. I'm baffled how to make this work in a query.

Regards,
Ken
 
This SQL will do it:

SELECT PersonName, MAX([DonationDate]) FROM DonationTable GROUP BY PersonName;

Be sure to 'PersonName' and 'DonationDate' with the actual names of your fields that hold that data and 'DonationTable' with the name of your Donation table.
 
Thank you! Perfect!
 

Users who are viewing this thread

Back
Top Bottom