Multipart Identifier And Functions

Posted by The King on Stack Overflow See other posts from Stack Overflow or by The King
Published on 2010-05-07T08:32:11Z Indexed on 2010/05/07 8:38 UTC
Read the original article Hit count: 174

Filed under:
|

Here is my Query... Here I'm using a function Fn_getStagesForProject()... For which I need to pass the SWProjectID from Projects Table...

The function takes the ID as parameter and return all stages that corressponds to the project, on which I need to filer only the row that contains StageLevel as 0.

    Select  A.SWProjectID, 
        A.ShortTitle, 
        C.StageName as StageName,
        B.ExpectedCompletionDate as BudgetedReleaseDate
    From Projects as A 
            left outer join ProjectBudgets as B on A.SWProjectID = B.SWProjectID
            Left outer join Fn_getStagesForProject(Projects.SWProjectID) as C on B.StageID = C.StageID
    Where C.StageLevel = 0

The error is

The multi-part identifier "Projects.SWProjectID" could not be bound.

I tried changing it to A.SWProjectID, but I still get the error...

Thanks in advance for your help. Let me know, incase you need the Table Structure

  • Raja

© Stack Overflow or respective owner

Related posts about sql-server-2005

Related posts about sql