Thread

Skip Navigation LinksForums > SpiraTeam Forums > SpiraTeam Issues & Questi... > Custom Query Help

Custom Query Help RSS Feed

Wednesday, April 17, 2013

Hi, I've written the following custom query but am having trouble getting the Count values for my requirments and incidents, as what is returned is  'System.Data.Query.ResultAssembly.BridgeDataReader' instead of an integer value.

Any idea how I can get this to work?

Thank you!

select R.CUST_05 AS IMPLEMENTATION_DATE, R.PROJECT_NAME, R.NAME AS RELEASE_NAME, R.RELEASE_ID, R.TASK_ESTIMATED_EFFORT AS ESTIMATED_EFFORT, R.TASK_ACTUAL_EFFORT AS ACTUAL_EFFORT,
(select value count(S.INCIDENT_ID) from SpiraTestEntities.R_Incidents as S where  S.DETECTED_RELEASE_ID = R.RELEASE_ID) AS INCIDENT_COUNT,
(select value count(Q.REQUIREMENT_ID) from SpiraTestEntities.R_Requirements as Q where R.RELEASE_ID = Q.RELEASE_ID && (NOT Q.IS_DELETED) && (Q.IMPORTANCE_ID = 1) && (NOT(Contains(Q.DESCRIPTION, 'AUDIT')))) AS REQUIREMENT_COUNT
from SpiraTestEntities.R_Releases as R
where (R.PROJECT_GROUP_ID = 19) && (R.ACTIVE_YN = 'Y') && (Cast(R.CUST_05 as DateTime) BETWEEN  AddDays(CurrentDateTime(), -7) AND AddDays(CurrentDateTime(), 0))
order by R.PROJECT_NAME, RELEASE_NAME

2 Replies
Vanessa SmithVanessa Smith
re: Vanessa Smith on Wednesday, April 17, 2013
Thursday, April 18, 2013

Follow-up: I got this to work by adding ANYELEMENT as a wrapper to my query.

For example:

ANYELEMENT(select value count(Q.REQUIREMENT_ID) from SpiraTestEntities.R_Requirements as Q where R.RELEASE_ID = Q.RELEASE_ID && (NOT Q.IS_DELETED) && (Q.IMPORTANCE_ID = 1) && (NOT(Contains(Q.DESCRIPTION, 'AUDIT')))) AS REQUIREMENT_COUNT

returns me a value of 11, which is correct!

Adam SAdam S
re: Vanessa Smith on Thursday, April 18, 2013
Thursday, April 18, 2013
Thanks for reposting the query with the answer.
Tagged
Statistics
  • Started: 4/17/2013
  • Last Reply: 4/18/2013
  • Replies: 2
  • Views: 715
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.