madman411 Posted August 2, 2021 Posted August 2, 2021 Hi all I'm looking to display to the user when the last payment was made for a lease (from the invoice table) to include date and amount paid. The payment table is related to the lease table by a LeaseID. Inside the invoice table I have Type (which defines the record as a "payment" or "charge"), Date, and Remittance, which is what needs to be shown. I'm assuming this would need to be an SQL statement where it gets the latest date from the invoice table where the record is marked as "payment" in the Type field. Then an additional calculation field to show the remittance amount. Can this be done natively?
Ocean West Posted August 2, 2021 Posted August 2, 2021 In the payment table create a DatePaid field calculation: If ( Payments::Type = "Payment" ; Date ) then in the script just calculate Max ( DatePaid ) setting a field. You could also do this with a WHILE function and avoid having to add extra calculation fields. 1
comment Posted August 2, 2021 Posted August 2, 2021 This post was recognized by Ocean West! comment was awarded the badge 'Great Support' and 1 points. Actually, you do not need to add anything to your schema for this. Just place a one-row portal to the payments table on the lease layout, sort it by date, descending (if the relationship is not sorted that way already) and filter it to show only records whose type is "payment". 1
madman411 Posted August 4, 2021 Author Posted August 4, 2021 Both techniques solved the issue. Thank you guys.
Recommended Posts
This topic is 1277 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now