I need to report on a computer that has one software package installed but not another. I am trying this. But the results are the same whether I have the "And ... Not Like" clause or not. I appreciate the assist.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblADusers.OU,
tblSoftwareUni.softwareName,
tblAssets.Username,
tblSoftware.softwareVersion
From tblAssets
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblADusers On tblAssets.Username = tblADusers.Username
Where tblSoftwareUni.softwareName Like '%package one%' And
tblSoftwareUni.softwareName Not Like '%package 2%' And tblAssetCustom.State = 1
Order By tblSoftwareUni.softwareName,
tblSoftware.softwareVersion,
tblAssets.AssetName