The previous script will give the oldest date ro pay a specific amount. Eg customer A, oldest to pat $150, customer A oldest date to pay $200 etc. Is that the requirement?
I understood the question to mean the oldest date by customer, and the amount payable on that date. If that is so, then
min(LastDayToPay) as LastDate
Group by BuyerNumber;
LastDayToPay as LastDate
should do the trick