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
 General SQL Server Forums
 New to SQL Server Programming
 getting data from multiple tables

Author  Topic 

iradev
Starting Member

45 Posts

Posted - 2010-05-27 : 09:39:55
SELECT Applicants.ApplicantId, Objects.FileAs, Phones.PhoneId, Phones.Num
FROM Applicants a INNER JOIN Objects ON Applicants.ApplicantId = Objects.ObjectID
INNER JOIN Phones ON Phones.ObjectId = Objects.ObjectID
WHERE (Applicants.PrimaryEmailAddressPhoneId IS NULL)
ORDER BY Objects.FileAs ASC

this is returning: Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "Applicants.ApplicantId" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "Applicants.PrimaryEmailAddressPhoneId" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "Applicants.ApplicantId" could not be bound.

what am i doing wrong? please help.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-27 : 09:43:07
For Applicants you have given the alias name a in the from clause so you have to use for example a.ApplicantId instead of Applicants.ApplicantId.
Or you can remove the alias name a


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

iradev
Starting Member

45 Posts

Posted - 2010-05-28 : 07:05:51
Thank you, it worked.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-28 : 07:51:35
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -