Quantcast
Viewing all articles
Browse latest Browse all 2021

Query Help

I need a solution

Hi,

This query compiles, but runs without returning any results. The fact that it compiled clean I would think is a good sign. But can someone correct any problems with it? Thanks.

 

SELECT     vComputer.Name AS 'Computer Name', vComputer.[IP Address], vComputer.[OS Name], vComputer.[OS Revision], vHWComputerSystem.Manufacturer,
                      vHWComputerSystem.Model, vHWComputerSystem.[Identifying Number] AS 'Serial Number', vHWProcessor.Model AS 'Processor',
                      vHWComputerSystem.[Total Physical Memory (Bytes)] / 1048576 AS 'RAM (MB)', I.Name AS 'Location', vComputer.[User] AS 'Primary Owner'
FROM         vComputer LEFT OUTER JOIN
                      ResourceAssociation AS loc ON (loc.ChildResourceGuid = vComputer.Guid OR
                      loc.ParentResourceGuid = vComputer.Guid) AND loc.ResourceAssociationTypeGuid = '05DE450F-39EA-4AAE-8C5F-77817889C27C' LEFT OUTER JOIN
                      vItem AS I ON loc.ChildResourceGuid = I.Guid LEFT OUTER JOIN
                      vHWProcessor ON vComputer.Guid = vHWProcessor._ResourceGuid LEFT OUTER JOIN
                      vHWComputerSystem ON vComputer.Guid = vHWComputerSystem._ResourceGuid

WHERE     (vComputer.IsManaged = 1) AND (vHWComputerSystem.Model LIKE '%nc6220%') OR (vHWComputerSystem.Model LIKE '%nc6320%') OR (vHWComputerSystem.Model LIKE '%6510b%') OR (vHWComputerSystem.Model LIKE '%6530b%') OR (vHWComputerSystem.Model LIKE '%6455b%') OR (vHWComputerSystem.Model LIKE '%nc6000%') OR (vHWComputerSystem.Model LIKE '%6465b%') OR (vHWComputerSystem.Model LIKE '%2510p%') OR (vHWComputerSystem.Model LIKE '%2530p%') OR (vHWComputerSystem.Model LIKE '%2540p%') OR (vHWComputerSystem.Model LIKE '%2560p%' OR vHWComputerSystem.Model LIKE '%2570p%' OR vHWComputerSystem.Model LIKE '%6475b%'  OR vHWComputerSystem.Model LIKE '%9470m%')

and vComputer.Name NOT IN (select vComputer.Name FROM vComputer
join Inv_AddRemoveProgram arp on vComputer.Guid=arp._ResourceGuid
where arp.DisplayName like '%PGP Desktop%')

ORDER BY 'Computer Name'

 


Viewing all articles
Browse latest Browse all 2021

Trending Articles