I am currently using the below report to scan assets with two versions of MS Office installed, however we have licenses for several other versions of Office. I wondering if someone could help me out with if it's possible to adjust this report to check more than two versions of Office, and show assets that have at least two of the versions installed. For example: scan for Office 2007, Office 2010, Office 2013, Office 2016, and show results with at least two of the four installed. Is something like this possible? Any advice would be appreciated.
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tsysIPLocations.IPLocation As [Office Location],
tblAssets.Username As [Last Logon User],
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion,
tsysOS.OSname As [Operating System],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Outer Join tsysIPLocations On tblAssets.IPNumeric >=
tsysIPLocations.StartIP And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join (Select Top 1000000 tblAssets.AssetID,
Count(tblSoftwareUni.SoftID) As OfficeCount
From tblAssets
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where (tblSoftwareUni.softwareName Like '%Office%2007%') Or
(tblSoftwareUni.softwareName Like '%Office%2010%')
Group By tblAssets.AssetID
Having Count(tblSoftwareUni.SoftID) > 1) SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Where (tblSoftwareUni.softwareName Like '%Office%2007%') Or
(tblSoftwareUni.softwareName Like '%Office%2010%')
Order By [Office Location],
tblAssets.AssetName,
tblAssets.Lastseen Desc