Hello all - i'm trying to do a left outer join onto an Alias table and it is telling me:
Here is the query:
Is there any way to work around this? I need to join the DEF table to the US table based on those two fields.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
The multi-part identifier "US.RQ_REQ_ID" could not be bound
Here is the query:
Code:
SELECT Null as ID,
Null as Parent_ID,
US.RQ_REQ_NAME as 'Name',
MIN(RCYC.RCYC_START_DATE) as 'Start Date',
MAX(RCYC.RCYC_END_DATE) as 'End Date',
COUNT(DEF.LN_BUG_ID) as '# Defects',
COUNT(COV.RC_ENTITY_ID) as '# Tests',
round(isnull(cast(sum(case when TEST.TC_STATUS = 'Passed' then 1 end) as float),0) / isnull(cast(COUNT(COV.RC_ENTITY_ID) as float),1),2)*100 as '% Complete',
RF.RQ_REQ_NAME as Primary_Ident,
NULL as Secondary_Ident
FROM REQ US, REQ RF, REQ IT, REQ PRJ, REQ_COVER COV, TESTCYCL TEST, REQ_RELEASES RD, RELEASES REL, RELEASE_CYCLES RCYC
LEFT OUTER JOIN(SELECT LK.LN_ENTITY_ID, LK.LN_BUG_ID, BG.BG_STATUS
FROM [LINK] LK
LEFT OUTER JOIN (SELECT BG_BUG_ID, BG_STATUS FROM BUG) BG
ON LK.LN_BUG_ID = BG.BG_BUG_ID
WHERE LN_ENTITY_TYPE = 'REQ'
--AND BG.BG_STATUS <> 'New'
AND BG.BG_STATUS <> 'Invalid'
AND BG.BG_STATUS <> 'Deferred'
AND BG.BG_STATUS <> 'Closed'
) DEF
ON US.RQ_REQ_ID = DEF.LN_ENTITY_ID
WHERE IT.RQ_FATHER_ID = PRJ.RQ_REQ_ID
AND RF.RQ_FATHER_ID = IT.RQ_REQ_ID
AND US.RQ_FATHER_ID = RF.RQ_REQ_ID
AND COV.RC_REQ_ID = US.RQ_REQ_ID
AND TEST.TC_TESTCYCL_ID = COV.RC_ENTITY_ID
AND US.RQ_REQ_ID = RD.RQRL_REQ_ID
AND RD.RQRL_RELEASE_ID = REL.REL_ID
AND REL.REL_ID = RCYC.RCYC_PARENT_ID
AND PRJ.RQ_FATHER_ID = '2517'
AND COV.RC_ENTITY_TYPE = 'TESTCYCL'
GROUP BY PRJ.RQ_REQ_NAME, IT.RQ_REQ_NAME, RF.RQ_REQ_NAME, US.RQ_REQ_NAME
Is there any way to work around this? I need to join the DEF table to the US table based on those two fields.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008