SELECT * FROM Invoices, Customers, Payments ; WHERE Invoice.CustNo = Customer.CustNo ; AND Customer.CustNo = <The Customer you want> ; AND Invoice.AmountDue > 0 ; GROUP BY Invoice.InvDate ; ORDER BY Invoice.InvDate ; INTO CURSOR InvTempYou now have a cursor with all invoices that have an outstanding balance for the customer you selected. You can SUM() the AmountDue for a date range to get the >90, 90, 60 stuff.