sql server - Getting The multi-part identifier error in sql query -


in sql query, getting error:

the multi-part identifier "a.position_id" not bound.

i'm not sure whats causing it. can help?

thanks.

select distinct     a.hirelastname, a.hirefirstname, a.hireid, a.position_id, a.barnumber,     a.archived, a.datearchived, b.position_name newhire a, workperiod c join position b on a.position_id = b.position_id      a.archived = 0      , a.hireid = c.hireid      , c.inquiryid not null  order      a.hireid desc, a.hirelastname, a.hirefirstname 

your code not join table c, think can cause issues alias a. can try this:

select distinct      a.hirelastname,      a.hirefirstname,      a.hireid,      a.position_id,      a.barnumber,      a.archived,      a.datearchived,      b.position_name newhire  join position b on a.position_id = b.position_id join workperiod c on a.hireid = c.hireid a.archived = 0 , c.inquiryid not null  order a.hireid desc, a.hirelastname, a.hirefirstname 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -