When I use the below query it works fine, except it shows me the totals for all systems. I need the totals for only active systems. I created a filter for active computers (from 9K computers, down to 6K). I have the guid for the filter as {xxxxx}. How do I filter the below query in SQL to reduce my report to just the active systems. I can do with ITA easily, but not sure how in SQL. Thanks in Advance for your help!
This is for CMS 7.1 (SP2)
SQL Query:
--------------------------------
SELECT DISTINCT
dca5_AddRemoveProgram.DisplayName AS Software,
dca5_AddRemoveProgram._SoftwareComponentGuid AS GUID,
dca5_AddRemoveProgram.DisplayVersion AS Version,
dca5_AddRemoveProgram.Publisher AS Company,
COUNT(dca5_AddRemoveProgram.DisplayName) AS Total
FROM
Inv_AddRemoveProgram AS dca5_AddRemoveProgram
INNER JOIN
vComputer AS vComputer ON vComputer.Guid = dca5_AddRemoveProgram._ResourceGuid
WHERE
dca5_AddRemoveProgram.DisplayName LIKE 'microsoft office%' AND --dca5_AddRemoveProgram.DisplayName LIKE 'microsoft office%' AND
((dca5_AddRemoveProgram.DisplayName NOT LIKE '%web%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%MUI%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%primary%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%IME%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%interface%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%security%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%runtime%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%activation%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%language%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%integration%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%update%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%live%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%components%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%viewer%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%programs%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%connector%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%service pack%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%trial%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%labs%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%plugin%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%proof%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%library%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%evaluation%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%sample%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%templante%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%lenguage%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%engine%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%add-in%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%inside%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%resource kit%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%chinese%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%Viewer%') AND
(dca5_AddRemoveProgram.DisplayName NOT LIKE '%Library%') AND
(dca5_AddRemoveProgram.InstallFlag LIKE '1'))
GROUP BY dca5_AddRemoveProgram.DisplayName,
dca5_AddRemoveProgram.DisplayVersion,
dca5_AddRemoveProgram.Publisher,
dca5_AddRemoveProgram._SoftwareComponentGuid