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
 multi-part identifier

Author  Topic 

srucker
Starting Member

26 Posts

Posted - 2008-06-18 : 10:34:51
use projectserver2003
select r.RES_NAME, p.PROJ_NAME, a.TASK_NAME, w.WWORK_START, w.WWORK_FINISH, w.WWORK_VALUE
from MSP_WEB_RESOURCES r,
MSP_WEB_ASSIGNMENTS a,
MSP_WEB_PROJECTS p,
MSP_WEB_WORK w
join MSP_VIEW_PROJ_TASKS_ENT TE on r.WPROJ_ID=TE.WPROJ_ID
join MSP_VIEW_PROJ_RES_ENT RE on r.WPROJ_ID=RE.WPROJ_ID
join MSP_VIEW_PROJ_PROJECTS_ENT PE on r.WPROJ_ID=PE.WPROJ_ID
where w.WWORK_TYPE = 1 -- actual work
and w.WASSN_ID = a.WASSN_ID
and a.WPROJ_ID = p.WPROJ_ID
and a.WRES_ID = r.WRES_ID


This statement is returning the following errors:

Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "r.WPROJ_ID" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "r.WPROJ_ID" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "r.WPROJ_ID" could not be bound.



I have all tables identified; however unclear as to why it cannot be bound.

Please help.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-18 : 10:36:48
Do you have column WPROJ_ID in table MSP_WEB_RESOURCES?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-18 : 10:51:59
And this is a strange mix of JOIN ansi types.
USE ProjectServer2003

SELECT r.RES_NAME,
p.PROJ_NAME,
a.TASK_NAME,
w.WWORK_START,
w.WWORK_FINISH,
w.WWORK_VALUE
FROM MSP_WEB_RESOURCES AS r
INNER JOIN MSP_WEB_ASSIGNMENTS AS a ON a.WRES_ID = r.WRES_ID
INNER JOIN MSP_WEB_WORK AS w ON w.WASSN_ID = a.WASSN_ID
INNER JOIN MSP_WEB_PROJECTS AS p ON p.WPROJ_ID = a.WPROJ_ID
INNER JOIN MSP_VIEW_PROJ_TASKS_ENT AS te ON te.WPROJ_ID = r.WPROJ_ID
INNER JOIN MSP_VIEW_PROJ_RES_ENT AS re ON re.WPROJ_ID = r.WPROJ_ID
INNER JOIN MSP_VIEW_PROJ_PROJECTS_ENT AS pe ON pe.WPROJ_ID = r.WPROJ_ID
WHERE w.WWORK_TYPE = 1



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-18 : 10:55:53
And always better to use the ANSI JOIN syntax as it has more clarity and other join syntax wont be supported from SQL 2005 compatibility level 90 onwards
Go to Top of Page

srucker
Starting Member

26 Posts

Posted - 2008-06-18 : 11:15:05
Thanks for the education on syntax. I found columns to join the tables on.

Much appreciated.
Go to Top of Page
   

- Advertisement -