Hello, and thanks in advance...
I need to include only the payment amount that corresponds to the max of the payment date field.
Here's what I have so far that's relevant:
<b><u>tblInvoices</u></b>
nfldidxClients
dfldPymtDate
cfldPymtAmount
<b><u>qryLatestAcctPayments</u></b>
<i>(A Totals query, using <b>tblInvoices</b>)</i>
Field: dfldPymtDate
Table: tblInvoices
Total: Max
Criteria: Is Not Null
Field: nfldidxClients
Table: tblInvoices
Total: Group By
<b><u>qrysrpt90Plus</u></b>
<i>(A Select query, using <b>qryLatestAcctPayments</b> and <b>tblInvoices</b> (among others), which returns records where the last payment was made more than 90 days ago)</i>
Field: MaxOfdfldPymtDate
Table: qryLatestAcctPayments
Criteria: <i>It works, omitted for simplicity's sake</i>
Field: nfldidxClients
Table: tblInvoices
So far, so good. When run, <b>qrysrpt90Plus</b> returns the desired records. However, when I add the field <b>tblInvoices.cfldPymtAmount</b> to try to return the most recent payment amount (the payment made on the date that corresponds to <i>MaxOfdfldPaymentDate</i>), I get all of the payments made on all of the dates. How can I get only the payment amount made on the most recent date?
I need to include only the payment amount that corresponds to the max of the payment date field.
Here's what I have so far that's relevant:
<b><u>tblInvoices</u></b>
nfldidxClients
dfldPymtDate
cfldPymtAmount
<b><u>qryLatestAcctPayments</u></b>
<i>(A Totals query, using <b>tblInvoices</b>)</i>
Field: dfldPymtDate
Table: tblInvoices
Total: Max
Criteria: Is Not Null
Field: nfldidxClients
Table: tblInvoices
Total: Group By
<b><u>qrysrpt90Plus</u></b>
<i>(A Select query, using <b>qryLatestAcctPayments</b> and <b>tblInvoices</b> (among others), which returns records where the last payment was made more than 90 days ago)</i>
Field: MaxOfdfldPymtDate
Table: qryLatestAcctPayments
Criteria: <i>It works, omitted for simplicity's sake</i>
Field: nfldidxClients
Table: tblInvoices
So far, so good. When run, <b>qrysrpt90Plus</b> returns the desired records. However, when I add the field <b>tblInvoices.cfldPymtAmount</b> to try to return the most recent payment amount (the payment made on the date that corresponds to <i>MaxOfdfldPaymentDate</i>), I get all of the payments made on all of the dates. How can I get only the payment amount made on the most recent date?