<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: Custom Query Help (Thread)</title><description> 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.  &#xD;
 Any idea how I can get this to work? &#xD;
 Thank you! &#xD;
 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 &amp;&amp; (NOT Q.IS_DELETED) &amp;&amp; (Q.IMPORTANCE_ID = 1) &amp;&amp; (NOT(Contains(Q.DESCRIPTION, 'AUDIT')))) AS REQUIREMENT_COUNT from SpiraTestEntities.R_Releases as R where (R.PROJECT_GROUP_ID = 19) &amp;&amp; (R.ACTIVE_YN = 'Y') &amp;&amp; (Cast(R.CUST_05 as DateTime) BETWEEN  AddDays(CurrentDateTime(), -7) AND AddDays(CurrentDateTime(), 0)) order by R.PROJECT_NAME, RELEASE_NAME </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/issues-questions/562.aspx</link><item><guid isPermaLink="false">threadId=562</guid><author>Vanessa Smith (vanessa.smith@flhosp.org)</author><title>Custom Query Help</title><description> 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.  &#xD;
 Any idea how I can get this to work? &#xD;
 Thank you! &#xD;
 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 &amp;&amp; (NOT Q.IS_DELETED) &amp;&amp; (Q.IMPORTANCE_ID = 1) &amp;&amp; (NOT(Contains(Q.DESCRIPTION, 'AUDIT')))) AS REQUIREMENT_COUNT from SpiraTestEntities.R_Releases as R where (R.PROJECT_GROUP_ID = 19) &amp;&amp; (R.ACTIVE_YN = 'Y') &amp;&amp; (Cast(R.CUST_05 as DateTime) BETWEEN  AddDays(CurrentDateTime(), -7) AND AddDays(CurrentDateTime(), 0)) order by R.PROJECT_NAME, RELEASE_NAME </description><pubDate>Wed, 17 Apr 2013 15:17:45 -0400</pubDate><a10:updated>2013-04-18T19:58:28-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/562.aspx</link></item><item><guid isPermaLink="false">messageId=1041</guid><author>Vanessa Smith (vanessa.smith@flhosp.org)</author><title> Follow-up: I got this to work by adding ANYELEMENT as a wrapper to my query. &#xD;
 For example:  &#xD;
 AN</title><description> Follow-up: I got this to work by adding ANYELEMENT as a wrapper to my query. &#xD;
 For example:  &#xD;
 ANYELEMENT(select value count(Q.REQUIREMENT_ID) from SpiraTestEntities.R_Requirements as Q where R.RELEASE_ID = Q.RELEASE_ID &amp;&amp; (NOT Q.IS_DELETED) &amp;&amp; (Q.IMPORTANCE_ID = 1) &amp;&amp; (NOT(Contains(Q.DESCRIPTION, 'AUDIT')))) AS REQUIREMENT_COUNT &#xD;
 returns me a value of 11, which is correct!  </description><pubDate>Thu, 18 Apr 2013 18:05:48 -0400</pubDate><a10:updated>2013-04-18T18:05:48-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/562.aspx#reply1041</link></item><item><guid isPermaLink="false">messageId=1042</guid><author>David J (adam.sandman+support@inflectra.com)</author><title>&#xD;
&#xD;
&#xD;
Thanks for reposting the query with the answer.</title><description>&#xD;
&#xD;
&#xD;
Thanks for reposting the query with the answer.</description><pubDate>Thu, 18 Apr 2013 19:58:28 -0400</pubDate><a10:updated>2013-04-18T19:58:28-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/562.aspx#reply1042</link></item></channel></rss>