I have a database that tracks client invoices with a one to many relationship. What I want to do is pull the last invoice for a client based on the invoice date.
Such as:
This statement gives me the max date OK but the invoice number and amount don't match up with the date.Code:strsql = "SELECT Nrcs.file_num, MAX(invoice.date), " strsql = strsql & "Invoice.amount, Invoice.invoice " strsql = strsql & "FROM openclose!nrcs INNER JOIN " strsql = strsql & "openclose!invoice ON Nrcs.file_num = Invoice.file_num " strsql = strsql & "Group By Nrcs.file_num"
I would appreciate any help with this. Thanks.




Reply With Quote