→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
05-24-2024 10:32 PM - edited 05-24-2024 10:44 PM
Solved! Go to Solution.
05-28-2024 06:17 PM - edited 05-28-2024 07:53 PM
I finally found the problem by simply stating the required conditions in MAIN-WHERE. In the original post, there is no need to perform SUB-SELECT in main-Where....Maybe we've all made things complicated
Here is the code that can filter normally:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblSoftwareUni.softwareName As Software,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSoftware On tblSoftware.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where (
(tblSoftwareUni.softwareName Like '%Software_Name_1%') Or
(tblSoftwareUni.softwareName Like '%Software_Name_2%')
) And
tblAssetCustom.State = 1
Order By tblAssets.IPAddress,
tblAssets.AssetName
05-28-2024 06:17 PM - edited 05-28-2024 07:53 PM
I finally found the problem by simply stating the required conditions in MAIN-WHERE. In the original post, there is no need to perform SUB-SELECT in main-Where....Maybe we've all made things complicated
Here is the code that can filter normally:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblSoftwareUni.softwareName As Software,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSoftware On tblSoftware.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where (
(tblSoftwareUni.softwareName Like '%Software_Name_1%') Or
(tblSoftwareUni.softwareName Like '%Software_Name_2%')
) And
tblAssetCustom.State = 1
Order By tblAssets.IPAddress,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now