Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
12-14-2009, 04:04 PM #1
- Join Date
- Aug 2009
- Thanked 0 Times in 0 Posts
select portion of my Update statement works but update doesn't...
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!
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
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