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

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

  • Saturday, December 29, 2012 2:18 PM
     
      Has Code
     
     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

    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.

All Replies

  • Saturday, December 29, 2012 3:47 PM
     
     Answered Has Code

    tblJobBudget is missing from the JOINs:

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

    Do not prefix tables with "tbl", it is counter productive.

    Kalman Toth SQL 2008 GRAND SLAM
    New Book: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012


  • Monday, December 31, 2012 6:14 AM
     
     

    Hi

    I think you wrongly referring a column for that it raise error or Misspelling the table name.

    Most of the time we should always be careful when using sub queries in our T-SQL statements and always keep in mind that sub queries can only provide their results to their outer queries and not references to the sub queries' tables. But no sub query exist in your SQL.
    Can you show us your table definition?


    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/