<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: DB Query in Spira Spits out Error for Unknown Reason (Thread)</title><description> Hello, &#xD;
 My company would like me to create  a sum of the test steps that have passed, failed, blocked, etc. instead of test cases.  &#xD;
 I tried to do my own SQL query - and it works when I access the database by the SQLCMD utility, but not in the Spira query under the custom reports. &#xD;
 Here it is - maybe someone will know what's going on? &#xD;
 SELECT &#xD;
 SUM(CASE WHEN execution_status_id=2 then 1 else 0 end) as Pass &#xD;
 FROM TST_TEST_STEP      (&lt;----From SQLCMD Utility - when I do it from the query I replace TST_TEST_STEP with SpiraEntities.R_TestSteps) &#xD;
 It is creating a sum correctly in the back door, but when I try and execute this in Spira I get ther error: &#xD;
  execution_status_id could not be resolved in current scope or context. &#xD;
 Any help would be appreciated. &#xD;
 Thanks, &#xD;
 Erin </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/952.aspx</link><item><guid isPermaLink="false">threadId=952</guid><author>Erin Welch (erin.welch@siemens.com)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">database</category><title>DB Query in Spira Spits out Error for Unknown Reason</title><description> Hello, &#xD;
 My company would like me to create  a sum of the test steps that have passed, failed, blocked, etc. instead of test cases.  &#xD;
 I tried to do my own SQL query - and it works when I access the database by the SQLCMD utility, but not in the Spira query under the custom reports. &#xD;
 Here it is - maybe someone will know what's going on? &#xD;
 SELECT &#xD;
 SUM(CASE WHEN execution_status_id=2 then 1 else 0 end) as Pass &#xD;
 FROM TST_TEST_STEP      (&lt;----From SQLCMD Utility - when I do it from the query I replace TST_TEST_STEP with SpiraEntities.R_TestSteps) &#xD;
 It is creating a sum correctly in the back door, but when I try and execute this in Spira I get ther error: &#xD;
  execution_status_id could not be resolved in current scope or context. &#xD;
 Any help would be appreciated. &#xD;
 Thanks, &#xD;
 Erin </description><pubDate>Fri, 11 Jul 2014 16:13:03 -0400</pubDate><a10:updated>2014-07-11T16:27:22-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/952.aspx</link></item><item><guid isPermaLink="false">messageId=1732</guid><author>Erin Welch (erin.welch@siemens.com)</author><title> Seems to work when I make the table as R.  &#xD;
 This finally generated correctly:  &#xD;
  SELECT  &#xD;
  SU</title><description> Seems to work when I make the table as R.  &#xD;
 This finally generated correctly:  &#xD;
  SELECT  &#xD;
  SUM(CASE WHEN R.EXECUTION_STATUS_ID=2 THEN 1 ELSE 0 END) AS PASSED,  &#xD;
  SUM(CASE WHEN R.EXECUTION_STATUS_ID=1 THEN 1 ELSE 0 END) as FAILED,  &#xD;
  SUM(CASE WHEN R.EXECUTION_STATUS_ID=6 THEN 1 ELSE 0 END) as CAUTION,  &#xD;
  SUM(CASE WHEN R.EXECUTION_STATUS_ID=5 THEN 1 ELSE 0 END) as BLOCKED,  &#xD;
  SUM(CASE WHEN R.EXECUTION_STATUS_ID=3 THEN 1 ELSE 0 END) as NOTRUN  &#xD;
  from SpiraTestEntities.R_TestSteps as R   &#xD;
  where R.PROJECT_ID = ${ProjectId}  &#xD;
 Thank you!  &#xD;
 Erin </description><pubDate>Fri, 11 Jul 2014 16:27:22 -0400</pubDate><a10:updated>2014-07-11T16:27:22-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/952.aspx#reply1732</link></item></channel></rss>