I have two tables, members and payments. I would like to produce a list of all members and their most recent payment information. I've been trying various ways of aggregating with the MAX function, but failing.
Any help would be greatly appreciated.
WHERE tblPayments.memberID = tblMembers.ID) as lastPaid
ORDER BY lastPaid DESC