;with records (Job_Number, Period_Year, Period_Number, TTLPerRev, TTLYTDRev, TTLJTDRev, TTLPerRABU, TTLYTDRABU,TTLJTDRABU) as ( select Job_Number, Period_Year, Period_Number, TTLPerRev = Col1 + Col2 + Col3, TTLYTDRev = Col4 + Col5 + Col6, TTLJTDRev = Col7 + Col8 + Col9, TTLPerRABU = Col10, TTLYTDRABU = Col11, TTLJTDRABU = Col12 from Table1 where Job_Number = @Job_Number and Period_Year = @Period_Year and Period_Number = @Period_Number ) select records.*, c.TTLPerRevAj, c.TTLYTDRevAj, c.TTLJTDRevAj from records cross apply ( select TTLPerRevAj = sum(Col1), TTLYTDRevAj = sum(Col2), TTLJTDRevAj = sum(Col3) from Table2 ) c;I don't see the need to involve the table variable here, but if you need it then you can add the line **insert into** just before the final select.
No one has followed this question yet.