perhaps this is what you wantselect [September 2012 Billing File] = CASE WHEN T2.[Application ID] IS NOT NULL AND T2.[ServerName] IS NOT NULL AND [Billed This Month] <> 0 THEN 'Y' ELSE 'N' ENDFROM [AEG_DB].[dbo].[TBL_Work] T1 LEFT JOIN ( SELECT [Application ID], [ServerName], [Billed This Month] = SUM([Billed This Month]) FROM [TBL_Data] WHERE [Data Period] = 'September 2012' GROUP BY [Application ID], [ServerName] ) T2 ON T1.[Application ID] = T2.[Application ID] AND T1.[ServerName] = T2.[ServerName]
KH[spoiler]Time is always against us[/spoiler]