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
 Transact-SQL (2005)
 Err: Multi-part identifier could not be bound

Author  Topic 

acesover
Starting Member

15 Posts

Posted - 2008-11-22 : 17:37:18
I am trying to get the following statement to work, but am getting the errors listed below. Any ideas? Thanks

select
sn.nid, soh.user1
from
soheader so join
snote sn on soh.user1 = substring(sn.sNoteText, 9, 12)
where soh.nid = 0

Server: Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "soh.user1" could not be bound.
Server: Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "soh.nid" could not be bound.
Server: Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "soh.user1" could not be bound.

nr
SQLTeam MVY

12543 Posts

Posted - 2008-11-22 : 18:38:16
well you don't have an alias soh - it's so
try

select
sn.nid, soh.user1
from soheader soh
join snote sn
on soh.user1 = substring(sn.sNoteText, 9, 12)
where soh.nid = 0


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

acesover
Starting Member

15 Posts

Posted - 2008-11-24 : 12:26:07
Thanks nr, I should know better than to write queries when I'm dead-tired.

Dan
Go to Top of Page
   

- Advertisement -