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.
A multipart identifier is any description of a field or table that contains multiple parts - for instance MyTable. SomeRow - if it can't be bound that means there's something wrong with it - either you've got a simple typo, or a confusion between table and column.
could not be bound. The main reason for this error is that the source table cannot be found, for example if you have statement such as Table1. OrderDate, and then if you get error above, this means that Table1 cannot be found in the query.
This typically means 1 of 2 things... you've referenced an object (table, trigger, stored procedure,etc) that doesn't actually exist (i.e., you executed a query to update a table, and that table doesn't exist). Or, the table exists, but you didn't reference it correctly...
If you run the above query, you will get this error — “Ambiguous name column”. This means two columns have the same column name — that is the “Name” column. The SQL Machine is confused as to which “Name” out of the two tables you are referring to. It is ambiguous — not clear.
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 ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With