IIF with 2 conditions

OP,
Looking at your table definition, you may have several other issues going on.
As you have both "Service1Note" and "Service2Note", this indicates you should have a tblTicketService child table to hold your service history. This would be for normalizing your database.

You also have flags for both isPaid and PartialPayment, but I don't see an amount. Internally how are you tracking the amount of each ticket? If this amount is stored in the ticket, you can create a linking table (Child table of two parents) to link your payments to the ticket and include the amount credited for each ticket. As a child to your ticket, you could then compare the original amount of the ticket to the amount(s) credited to that ticket in payments to determine if the ticket is paid or has a partial payment. If you include the date applied in the linking table you could also know the last date of an applied payment to see if they are delinquent.
 

Users who are viewing this thread

Back
Top Bottom