‎02-22-2019 07:28 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblSoftwareUni.softwareName,
tblFileVersions.FilePathfull,
Case
When tblFileVersions.Found Is Null Then 'Not checked'
When tblFileVersions.Found = 0 Then 'Not found'
Else 'Found'
End As FilePresent
From tblAssets
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join tblFileVersions On tblAssets.AssetID = tblFileVersions.AssetID
Where tblSoftwareUni.softwareName Like 'GSG Windows Application' And
tblFileVersions.FilePathfull Like '%certadddate.txt%' And
(tblFileVersions.Found Is Null Or tblFileVersions.Found = 0)
Order By tblAssets.AssetName
‎03-01-2019 07:21 PM
Select Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblSoftwareUni.softwareName,
--tblFileVersions.FilePathfull, report has been changed to not show found paths
--was likely a source of you seeing duplicates
Case
When tblFileVersions.Found Is Null Then 'Not checked'
Else 'Not found'
--changed name
End As FilePresence
From tblAssets
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
--Changed to Left Join
Left Join tblFileVersions On tblAssets.AssetID = tblFileVersions.AssetID
Where
tblSoftwareUni.softwareName Like 'GSG Windows Application'
--might be good to remove the below line as well, not sure
And tblFileVersions.FilePathfull Like '%certadddate.txt%'
--And (tblFileVersions.Found Is Null Or tblFileVersions.Found = 0)
--This should make it so the report will not show assets that have the cert file
--in at least one location
And tblAssets.AssetID not in (
Select tblFileVersions.AssetID
From tblFileVersions
Where
tblFileVersions.FilePathfull Like '%certadddate.txt%'
)
And tblFileVersions.Found = 1
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now