CAST(0 AS numeric(12,2)) as julPrior,Which is then followed by
update TempRevenues set julPrior = (select amount from [RTA-Revenues] where category = TempRevenues.CATEGORY and MONTH(receiveddate)=7 and fisyear = TempRevenues.FISYEAR - 1 )to populate it. Can you think of a way to do this in 1 step instead of 2? I suppose the CASE could be worked into that second line as well but what I'd really like to do is eliminate that second line.
>>SUM(CASE WHEN month([receiveddate])=7 THEN [AMOUNT] ELSE 0.00 END) as Jul >>>>