Please my intention is to show the code that I have problem with in a different colour but it didnt work. so please ignore the colour code.
I want to know how to use this code in a GROUP BY clause
isnull((SELECT sum(bi.PROGRESS_BIL + bi.HARD_BIL + bi.SOFT_BIL + bi.FEES_BIL + bi.OAFEE_BIL + bi.RETAINER_BIL + bi.PREMDISC_BIL - bi.CREDIT_TOT)
FROM bo_Live5.dbo.BLT_BILLM bi
WHERE bi.MATTER_UNO = m.MATTER_UNO), 0) AS billings_to_date