Re: [Emerald] Need help on a query

Dale E. Reed Jr. ( (no email) )
Fri, 30 Apr 1999 09:59:41 -0700

> Kurt Schafer wrote:
>
> I would like to perform a query that goes through the MasterAccounts,
> and for any client that has a balance of 0 or more, (credit) pay out
> any invoices in the Invoice table that are missing a payment ID for
> that customer.
>
> Can anybody help me out ?

The latest Emerald does this already when you make a payment that
brings the account to 0 or a credit. Here is a quick query to
accomplish the same. Please (as always) make a backup before running
it. :)

Update ii
Set PaymentID = (Select Max(PaymentID) From Payments Where CustomerID =
ma.CustomerID)