开发者

Multipart Identifier And Functions

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


Change LEFT OUTER JOIN Fn_getStagesForProject to CROSS APPLY Fn_getStagesForProject.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜