Hi
I've got a problem with a database I'm checking. I need to group a selection of records using 'group by', but then select the top record of that group, eg. select a person and payment date, then select last payment made by that person based upon year and display in a query, so it look like: name: Joe Bloggs last payment date: 01/01/2005.
The information is based on two tables - one = main details which include name/personal information, the other = payment/subscription information. The relationship is a one-to-many as one individual can subscribe each year and records kept to track previous years payments. The results will be fed into a report in order to print out who have lapsed membership.
Select query that I have is:
SELECT DISTINCTROW FirstName, LastName, ID, Payments.DatePaid
FROM Details LEFT JOIN Payments ON Details.ID = Payments.ID
WHERE (((Details.LastName) Is Not Null) AND ((DatePart("yyyy",[DatePaid]))<2006) AND ((Payments.PaymentDescription)="membership"));
Problem is this brings up all payment records for one person.
Sorry, probably easy to do.
Any info gratefully received.
Lindsey
