→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !
‎09-08-2021 06:49 PM
Select Top 1000000 tblassets.AssetID,
tblassets.AssetName,
tsysassettypes.AssetTypename,
tsysassettypes.AssetTypeIcon10 As icon,
tblassets.IPAddress,
tblassets.Lastseen,
tblassets.Lasttried,
tblSoftwareUni.softwareName
From tblassets
Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
Inner Join lansweeperdb.dbo.tblSoftware On tblassets.AssetID =
tblSoftware.AssetID
Inner Join lansweeperdb.dbo.tblSoftwareUni On tblSoftwareUni.SoftID =
tblSoftware.softID
Where
tblSoftwareUni.softwareName =
'Microsoft Visual C++ 2008 Redistributable - x86' And
tblSoftwareUni.softwareName = 'Windows Internet Explorer 11' And
tblassetcustom.State = 1
Solved! Go to Solution.
‎09-08-2021 09:45 PM
‎09-10-2021 06:57 PM
From tblassets
Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where tblSoftwareUni.softwareName Like '%SAP Interactive Excel%'
And tblSoftware.softwareVersion = '3.0.8.20036'
) As s1 On s1.AssetID = tblassets.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where tblSoftwareUni.softwareName Like '%SAP Business Explorer%'
And tblSoftware.softwareVersion = '7.60'
) As s2 On s2.AssetID = tblassets.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where
tblSoftwareUni.softwareName Like '%SAP GUI for Windows 7.60 (Patch 5)%'
And tblSoftware.softwareVersion = '7.60 Compilation 1'
) As s3 On s3.AssetID = tblassets.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where tblSoftwareUni.softwareName Like '%SAP Business Client 7.0%'
And tblSoftware.softwareVersion = '7.0 PL10'
) As s4 On s4.AssetID = tblassets.AssetID
Inner Join lansweeperdb.dbo.tsysOS On tsysOS.OScode = tblassets.OScode
Where
tblassetcustom.State = 1
Order By
tblassets.AssetName
Where
tblassetcustom.State = 1
AND s1.AssetID IS NOT NULL -- match found
AND s2.AssetID IS NOT NULL -- match found
AND s3.AssetID IS NOT NULL -- match found
AND s4.AssetID IS NULL -- no match
‎09-08-2021 09:45 PM
‎09-10-2021 09:06 AM
‎09-09-2021 08:46 AM
RC62N wrote:
Something like this? Just add a check for tblSoftware.SoftwareVersion on each software check.
Select Top 1000000 tblassets.AssetID,
tblassets.AssetName,
tsysassettypes.AssetTypename,
tsysassettypes.AssetTypeIcon10 As icon,
tsysOS.OSname As OS,
tblassets.Version As Build,
tblassets.Username,
s1.SoftwarePublisher As [soft1 Publisher],
s1.softwareName As [soft1 Name],
s1.softwareVersion As [soft1 Version],
s2.SoftwarePublisher As [soft2 Publisher],
s2.softwareName As [soft2 Name],
s2.softwareVersion As [soft2 Version],
s3.SoftwarePublisher As [soft3 Publisher],
s3.softwareName As [soft3 Name],
s3.softwareVersion As [soft3 Version],
s4.SoftwarePublisher As [soft4 Publisher],
s4.softwareName As [soft4 Name],
s4.softwareVersion As [soft4 Version],
tblassets.Lastseen,
tblassets.Lasttried
From tblassets
Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where tblSoftwareUni.softwareName Like '%SAP Interactive Excel%') As s1 On
s1.AssetID = tblassets.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where tblSoftwareUni.softwareName Like '%SAP Business Explorer%') As s2 On
s2.AssetID = tblassets.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where
tblSoftwareUni.softwareName Like '%SAP GUI for Windows 7.60 (Patch 5)%')
As s3 On s3.AssetID = tblassets.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.softwareName,
tblSoftware.softwareVersion
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where tblSoftwareUni.softwareName Like '%SAP Business Client 7.0%') As s4 On
s4.AssetID = tblassets.AssetID
Inner Join lansweeperdb.dbo.tsysOS On tsysOS.OScode = tblassets.OScode
Where s1.softwareName = 'SAP Interactive Excel' And s1.softwareVersion =
'3.0.8.20036' And s2.softwareName = 'SAP Business Explorer' And
s2.softwareVersion = '7.60' And
s3.softwareName = 'SAP GUI for Windows 7.60 (Patch 5)' And
s3.softwareVersion = '7.60 Compilation 1' And s4.softwareName =
'SAP Business Client 7.0' And s4.softwareVersion = '7.0 PL10' And
tblassetcustom.State = 1
Order By tblassets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now