The multi-part identifier could not be bound
Asked Answered
P

1

6

trying this

select tblPersonalInfo.companyname, tblJobBudget.title,tblJobBudget.lastmodifiedby,
tblJobAdv.advtitle, tblJobAdv.userId,       
tblApplication.advid, tblApplication.position
from tblJobAdv 
inner join tblApplication
ON tblJobAdv.advid = tblApplication.advid
inner join tblPersonalInfo
On tblJobBudget.lastmodifiedby = tblPersonalInfo.userid

gives error

Msg 4104, Level 16, State 1, Line 8
The multi-part identifier "tblJobBudget.lastmodifiedby" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "tblJobBudget.title" could not be bound.
Msg 4104, Level 16, State 1, Line 2

The multi-part identifier "tblJobBudget.lastmodifiedby" could not be bound.

Phlebitis answered 29/12, 2012 at 14:20 Comment(0)
P
5

This is because there aren't any table or table alias with tblJobBudget identifier.

Your tables are:

  • tblJobAdv
  • tblApplication
  • tblPersonalInfo

But not:

  • tblJobBudget

If you need columns from table tblJobBudget you should include tblJobBudget in tables with a join clause:

from       tblJobAdv 
inner join tblApplication
   ON tblJobAdv.advid = tblApplication.advid
inner join tblJobBudget                              <--here
   ON ...
inner join tblPersonalInfo
   ON ...
Pierre answered 29/12, 2012 at 14:42 Comment(1)
SELECT tblApplication.advid, tblApplication.scrdoc, tblApplication.position, tblJobAdv.advtitle, tblJobBudget.title, tblPersonalInfo.country, tblPersonalInfo.city,tblPersonalInfo.companyname FROM tblApplication INNER JOIN tblJobAdv ON tblApplication.advid = tblJobAdv.advid INNER JOIN tblJobBudget ON tblJobAdv.jbid = tblJobBudget.jbid inner join tblPersonalInfo On tblPersonalInfo.userid = tblJobBudget.lastmodifiedby where tblApplication.position = 'selected'Phlebitis

© 2022 - 2024 — McMap. All rights reserved.