1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
select
distinct CAST(CAST(CAST(T24.action_timestamp as float) as int) as datetime) AS Date,
(select
count(T19.dbid)
from tmtestcase T19,history T249,tmtestplan T29,tmtestplan T349,tmtestplan T359
where T19.dbid = T249.entity_dbid
and 16777253 = T249.entitydef_id
and T19.parentplan = T29.dbid
and T29.parentplan = T349.dbid
and T349.parentplan = T359.dbid
and (T19.dbid <> 0 and ((T29.dbid = @Param_TestPlanN2 or T349.dbid = @Param_TestPlanN2 or T359.dbid = @Param_TestPlanN2)))
and CAST(CAST(T249.action_timestamp as float) as int) <= CAST(CAST(T24.action_timestamp as float) as int)
and T249.new_state ='Planned'
and T249.dbid =
(select max(T2000.dbid)
from tmtestcase T1000,history T2000
where T1000.dbid = T2000.entity_dbid
and 16777253 = T2000.entitydef_id
and (T1000.dbid <> 0)
and T1000.dbid = T19.dbid
and CAST(CAST(T2000.action_timestamp as float) as int) <= CAST(CAST(T24.action_timestamp as float) as int)
)
) AS Planned,
(select
count(distinct T19.dbid)
from tmtestcase T19,history T249,tmtestplan T29,tmtestplan T349,tmtestplan T359
where T19.dbid = T249.entity_dbid
and 16777253 = T249.entitydef_id
and T19.parentplan = T29.dbid
and T29.parentplan = T349.dbid
and T349.parentplan = T359.dbid
and (T19.dbid <> 0 and ((T29.dbid = @Param_TestPlanN2 or T349.dbid = @Param_TestPlanN2 or T359.dbid = @Param_TestPlanN2)))
and CAST(CAST(T249.action_timestamp as float) as int) <= CAST(CAST(T24.action_timestamp as float) as int)
and CAST(CAST((select top 1 T2000.action_timestamp
from tmtestcase T1000,history T2000
where T1000.dbid = T2000.entity_dbid
and 16777253 = T2000.entitydef_id
and (T1000.dbid <> 0)
and T1000.dbid = T19.dbid
order by T2000.dbid asc
)as float) as int) <= CAST(CAST(T24.action_timestamp as float) as int)
) AS Total
from tmtestcase T1,history T24,tmtestplan T2,tmtestplan T34,tmtestplan T35
where T1.dbid = T24.entity_dbid
and 16777253 = T24.entitydef_id
and T1.parentplan = T2.dbid
and T2.parentplan = T34.dbid
and T34.parentplan = T35.dbid
and (T1.dbid <> 0 and ((T2.dbid = @Param_TestPlanN2 or T34.dbid = @Param_TestPlanN2 or T35.dbid = @Param_TestPlanN2)))
and T24.action_timestamp > dateadd(D,-CAST (@Param_Historique AS Integer),getdate()) |
Partager