How do we use SUM in side update statement. Please review the below query and help me
select [September 2012 Billing File] = CASE WHEN T2.[Application ID] IS NOT NULL AND T2.[ServerName]
IS NOT NULL AND Sum([Billed This Month]) <> 0 THEN 'Y' ELSE 'N' END
FROM [AEG_DB].[dbo].[TBL_Work] T1
LEFT JOIN [TBL_Data] T2 ON (T1.[Application ID] = T2.[Application ID] AND T1.[ServerName] = T2.[ServerName])
WHERE T2.[Data Period] = 'September 2012'