In the below transaction I wrote everytime I run the full trans action I get the following error message:

Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "a.SumOfVolume" could not be bound.


but If I just run the select portion of the transaction with out the update statment, query runs fine.

Can some one please tell me whats happening here? Thanks in advance!


Full Query:
BEGIN TRANSACTION
UPDATE dbo.cdm_CDMCommon
SET YTDVolume = a.SumOfVolume
SELECT b.CDMMasterID as CDMMasterID
,a.[DeptUse] as [File DeptNum]
,b.DeptID as DeptID
,c.[StdDeptDesc] as [StdDeptDesc]
,a.[Charge Code] as [File Charge Code]
,b.ChargeCode as ChargeCode
,a.SumOfVolume as [File Vol]
,d.YTDVolume as [Vol Currently on CDMM]

FROM PRODDB1.[Level2WorkArea].[dbo].[SB05VolMG] a
,[NRS12PPDB12].[CDMM_STBARNHC].[dbo].[cdm_CDMMaster] b
,PRODDB1.[OSIDB].[dbo].[osit_DeptInfo] c
,[NRS12PPDB12].[CDMM_STBARNHC].[dbo].[cdm_CDMCommon] d

WHERE
a.[Charge Code] = b.ChargeCode
and c.CDMID = b.CDMID
and c.DeptID = b.DeptID
and c.Department= a.[DeptUse]
and c.HospID ='SB05'
and b.CDMMasterID = d.CDMMasterID