The following SQL is giving me the message:
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'ProductCode'.
How can I correct this code. The column name does exist in the table. I also want to group by Product Code and not by Container Name.
SELECT a.ProductCode AS "Product Name", a.TestContainerName as "Test Container", Sum (a.Passed + a.Failed) AS Executed, Sum(a.Passed) AS Passed,
Sum(a.Failed) AS Failed, Sum(a.NotExecuted) AS "Not Executed",
Sum(a.NotScheduled) AS "Not Scheduled"
SELECT td.TestContainerName, th.TreeOrder,
CASE when td.TestCovStatusID=1 then 1 else 0 end AS Passed,
CASE when td.TestCovStatusID=2 then 1 else 0 end AS Failed,
CASE when td.TestCovStatusID=3 then 1 else 0 end AS NotExecuted,
CASE when td.TestCovStatusID=4 then 1 else 0 end AS NotScheduled,
CASE when td.TestCovStatusID=5 then 1 else 0 end AS Executed
SELECT DISTINCT tdc.ProductCode, tds.TestContainerID, tds.TestContainerName, tds.TestID,
CASE when tds.CurrentExecStatus=8 then 1
else CASE when tds.CurrentExecStatus=9 then 2
else tds.CurrentExecStatus end
end AS TestCovStatusID
FROM TM_V_TestDefinitions tds, RTM_V_TestHierarchie th, RTM_V_TestDefsComponents tdc
WHERE tds.ProjectID = th.ProjectID_fk
and tdc.ProjectID = th.ProjectID_fk
) td INNER JOIN RTM_V_TestHierarchie th ON (th.NodeID_pk = td.TestContainerID)
GROUP BY a.TestContainerName, a.TreeOrder
ORDER BY a.TreeOrder
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.
Your password has been sent to:email@example.com
To follow this tag...
Thanks! We'll email you when relevant content is added and updated.
Share this item with your network: