But a customer would only have one invoice. And that invoice has to have fields for the current balance, the 1-30 balance, the 30-60 balance, the 60-90 balance, and the 90+ balance.
Otherwise, if I credit, say, the 30-60 balance, where would I put the new balance?
I'm sorry if I'm sounding dense. This is really confusing.
Thanks,
-Michelle
>
>You can calculate it on the run. Something like this;
>
>
>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 InvTemp
>
>
>You 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.