P
(PeteCresswell)
Got a table: "tblPayment" that has payment amounts (in dollars) by TrancheID.
A given Tranche may have thrown off 100 payments or no payments at all.
For those that have at least one payment, I need to retrieve the most recent 1
or two payments and, if 2, average them so that we wind up with three columns:
Payment#1, Payment#2, and Average.
We've got a !PaymentDate field.
If I can do it all in SQL instead of beating down a .Recordset in VBA, I'd
prefer that - if only for my own edification.
Anybody know how this is done?
A given Tranche may have thrown off 100 payments or no payments at all.
For those that have at least one payment, I need to retrieve the most recent 1
or two payments and, if 2, average them so that we wind up with three columns:
Payment#1, Payment#2, and Average.
We've got a !PaymentDate field.
If I can do it all in SQL instead of beating down a .Recordset in VBA, I'd
prefer that - if only for my own edification.
Anybody know how this is done?