I’m trying add two flowfields to the customer tables. I want Last payment amount and last payment date. So basically I need to make a flowfield that looks up the lastest posting date with a document type of “Payment”. I can get each one of those but I can’t get the lastest date, it gets the first one that is in the table. Any thoughts of how I can get the last payment? The SQL would be something like this.
SELECT Amount, Posting Date FROM Cust. Ledger Entry WHERE Customer No. = “No.”, Document Type = ‘Payment’ ORDER BY Posting Date Desc LIMIT 1
I thought that might be it but I need to see the latest payment date, and the amount that is tied to that. So if I pick the max date, that will work, but how do I pick the amount that is along with that date? Maybe I should just make a function that fills it in and do a FIND(’+’)