Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Error - The multi-part identifier "S.RGU_count"

Author  Topic 

hammad.eh
Starting Member

2 Posts

Posted - 2011-10-28 : 07:29:47
Hello!

Can someone please help me out...im getting the following error

The multi-part identifier "S.RGU_count" could not be bound.

on the following code that i have written:


UPDATE S1
SET
S1.Sales = ISNULL(S.Sales, 0),
S1.RGU_Count = ISNULL(S.RGU_count, 0)
From
#SkillSummary1 S1
Left outer join
( Select
SUM(Sales) Sales,
SUM(RGU_Count) RGU_Count,
Skill
From #Sales S
Where S.Skill = '309'
GROUP BY
S.Skill
) Temp2
ON Temp2.Skill = S1.Skill



Can anyone please help out??

Thanks in advance!



--

Hammad Ehtesham

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-28 : 07:33:53
it should be Temp2 instead

UPDATE S1
SET
S1.Sales = ISNULL(STemp2.Sales, 0),
S1.RGU_Count = ISNULL(STemp2.RGU_count, 0)
From
#SkillSummary1 S1
Left outer join
( Select
SUM(Sales) Sales,
SUM(RGU_Count) RGU_Count,
Skill
From #Sales S
Where S.Skill = '309'
GROUP BY
S.Skill
) Temp2
ON Temp2.Skill = S1.Skill


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

hammad.eh
Starting Member

2 Posts

Posted - 2011-10-28 : 08:48:04
Oh i get it! Thanks a lot for the prompt response! :)

--

Hammad Ehtesham
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-28 : 09:14:09
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -