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
 Microsoft OLE DB Provider for ODBC Drivers error '

Author  Topic 

noks
Starting Member

9 Posts

Posted - 2007-05-21 : 06:02:59
Hi guys

I wanna display the compname [in competencies tbl], firstname & surname [in users tbl], position level [in positions tbl] and userlevel [in compuser tbl] but i get the ff error msg

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]The column prefix 'CompUser' does not match with a table name or alias name used in the query.

My code:

SELECT compname, firstname,surname ,level AS positionlevel
FROM positions, compuser, users A, comppos
INNER JOIN Competencies
ON comppos.Compid = competencies.Compid
RIGHT JOIN Users
ON CompUser.UserID = Users.UserID
WHERE Users.UserID = '999209'
OR Users.UserID = 'helpdesk1'
OR Users.UserID = '999339'
OR Users.UserID = 'helpdesk5'
ORDER BY CompName

Pls kindly help
Noks

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-21 : 06:19:33
your select is wrong.

read about how to properly write joins.

From table1 t1
join table2 t2 on t1.id = t2.id
join table3 t3 on t2.id = t3.id
...


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -