>>If paid = "YES", your select won't select it...
>
>OK - but CloseClaim <> YES , Invoice_No is > 0 and amt_paid is < the sum of all feesubmits. All the other conditions are valid.
>
You have AND after paid <> "YES". If paid = "YES", nothing after that point matters (and the rest of the stuff is not even evaluated).
where services.paid <> "YES" .AND. ;
services.billed ="YES" .and.;
Steve Gibson