By Mark Chinsky • February 11th, 2009
From Clients First Business Solutions and 90minds

Use this query to show you a list of open balances by customer group. If you would like to see

open balances by vendor, then change the Where clause to cs.cardtype = ‘S’.

/* Shows the open balances by Customer Group */
SELECT gp.GroupCode, gp.GroupName, Sum(cs.Balance) ‘Open Balance’

FROM OCRD cs
INNER JOIN OCRG gp ON gp.GroupCode = cs.GroupCode

WHERE cs.CardType = ‘C’

GROUP BY gp.GroupCode, gp.GroupName
ORDER BY GroupName FOR BROWSE

Thanks to Ed Monk of SBONotes.com