Now, I'm looking for a reverse query, one that shows which PC's don't have a given piece of software. This report will show me them, but also includes all the other software installed, making the report unmanageable.
How would I modify it to include just computers that do not have "softwareX"
computer1 softwareA
computer1 softwareB
computer1 softwareC
computer1 softwareD
computer2 softwareE
computer2 softwareG
computer2 softwareL
computer2 softwareM
so it just shows:
computer1 (I can hide this column in the final report)
computer2 (I can hide this column in the final report)
SELECT TOP 1000000 tblcomputers.computername,
tblcomputers.computerunique,
web40osname.compimage AS icon,
web40osname.osname,
tblcomputers.sp AS
[Service Pack],
tblcompcustom.location,
tblcompcustom.department AS
[Research Unit],
tblcompcustom.custom1 AS [User Name],
tsyschassistypes.chassisname AS Type,
tblcompcustom.barcode AS
[Inventory Number],
CONVERT(VARCHAR(10), tblbios.releasedate, 20) AS ReleaseDate,
tblsystemenclosure.serialnumber,
tblsoftware.softwarename,
tblsoftware.softwareversion,
tblsoftware.softwarepublisher
FROM tblcomputers
LEFT OUTER JOIN web40processorcapacity
ON tblcomputers.computername =
web40processorcapacity.computername
INNER JOIN web40activecomputers
ON tblcomputers.computername = web40activecomputers.computername
LEFT JOIN web40correctmemory
ON web40correctmemory.computername = tblcomputers.computername
LEFT JOIN web40osname
ON web40osname.computername = tblcomputers.computername
LEFT JOIN tblcomputersystemproduct
ON tblcomputers.computername =
tblcomputersystemproduct.computername
LEFT JOIN tblcompcustom
ON tblcomputers.computername = tblcompcustom.computername
LEFT JOIN tblbios
ON tblcomputers.computername = tblbios.computername
LEFT JOIN tblsystemenclosure
ON tblcomputers.computername = tblsystemenclosure.computername
LEFT JOIN tsyschassistypes
ON tsyschassistypes.chassistype = tblsystemenclosure.chassistypes
INNER JOIN tblsoftware
ON tblcomputers.computername = tblsoftware.computername
WHERE tblsoftware.softwarepublisher NOT LIKE '%softwareX%'
ORDER BY dbo.tblcomputers.computername