Hello All. I'm going to try and explain my issue and see if people can help.
Background knowledge: We have Projects, that have Iterations, that have Releases, that have User Stories (Requirements).
Projects > Iterations > Releases > Requirements
But the database doesn't see it like that. so i'm trying to come up with a way to have an ID and then a Parent ID so i can feed this data to a treeview and have it cascade.
So the ParentID of an Iteration would be the Project and ParentID of Releases would be the Iteration etc...
Here are the Project and Iteration queries. I have added a RowID but don't know where to go from here.
I need to know how to make the parent ID of the Projects equal 0 and the parent ID's of the Iterations equal their corresponding Project.
I have attached the data being returned from both of these queries.
- 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
Background knowledge: We have Projects, that have Iterations, that have Releases, that have User Stories (Requirements).
Projects > Iterations > Releases > Requirements
But the database doesn't see it like that. so i'm trying to come up with a way to have an ID and then a Parent ID so i can feed this data to a treeview and have it cascade.
So the ParentID of an Iteration would be the Project and ParentID of Releases would be the Iteration etc...
Here are the Project and Iteration queries. I have added a RowID but don't know where to go from here.
Code:
--Project Level Data
select [RowId] = CAST(ROW_NUMBER() OVER(ORDER BY MIN(r.Rel_Start_Date)) AS INT),
c.CY_User_05 as 'Project',
MIN(r.Rel_Start_Date) as 'Start Date', --change to REL_USER_02 on live DB
MAX(r.Rel_End_Date) as 'End Date', --change to REL_USER_05 on live DB
count(distinct ts.TS_NAME) as '# Tests',
round(cast(sum(case when tc.TC_STATUS = 'Passed' then 1 end) as float) / cast(count(distinct ts.TS_NAME) as float),2)*100 as '% Complete'
FROM dbo.test ts
, dbo.CYCLE c
, dbo.testcycl tc
, dbo.RELEASE_CYCLES rc
, dbo.RELEASES r
where ts.ts_test_id = tc.tc_test_id
and c.cy_cycle_id = tc.tc_cycle_id
and tc.TC_ASSIGN_RCYC= rc.RCYC_ID
and rc.RCYC_PARENT_ID = r.REL_ID
and c.CY_USER_05 IS NOT NULL
Group By c.cy_user_05
Code:
--Iteration Level Data
select [RowId] = CAST(ROW_NUMBER() OVER(ORDER BY MIN(r.Rel_Start_Date)) AS INT),
c.CY_USER_06 as 'Iteration',
MIN(r.Rel_Start_Date) as 'Start Date', --change to REL_USER_02 on live DB
MAX(r.Rel_End_Date) as 'End Date', --change to REL_USER_05 on live DB
count(distinct ts.TS_NAME) as '# Tests',
round(cast(sum(case when tc.TC_STATUS = 'Passed' then 1 end) as float) / cast(count(distinct ts.TS_NAME) as float),2)*100 as '% Complete'
from dbo.test ts
, dbo.CYCLE c
, dbo.testcycl tc
, dbo.RELEASE_CYCLES rc
, dbo.RELEASES r
where ts.ts_test_id = tc.tc_test_id
and c.cy_cycle_id = tc.tc_cycle_id
and tc.TC_ASSIGN_RCYC= rc.RCYC_ID
and rc.RCYC_PARENT_ID = r.REL_ID
and c.CY_USER_05 IS NOT NULL
Group By c.CY_User_05, c.CY_USER_06
I need to know how to make the parent ID of the Projects equal 0 and the parent ID's of the Iterations equal their corresponding Project.
I have attached the data being returned from both of these queries.
- 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