cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
support_ict
Engaged Sweeper
I'm trying to create a report that is given me a list of assets that haven't installed a package and are not listed in a static assets group, but I'm getting an sql-error .

The error says = The columns in the subquery do not match. [ Column ordinal = 2,Column name = AssetID ]
I cannot figure out what is wrong.


My sql code =


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblOperatingsystem.Caption,
tblAssets.IPNumeric,
tblAssets.Username
From tblAssets
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblRegistry On tblAssets.AssetID = tblRegistry.AssetID
Where tblAssets.AssetID Not In (Select tblAssetGroupLink.AssetID,
tblAssetGroupLink.AssetGroupID As AssetGroupID1,
tblAssets.AssetName
From tblAssetGroupLink Inner Join tblAssets On tblAssets.AssetID =
tblAssetGroupLink.AssetID
Where tblAssetGroupLink.AssetGroupID = 31) And (tblAssets.AssetID Not In
(Select tblAssets.AssetID
From tblAssets Inner Join tblRegistry On tblAssets.AssetID =
tblRegistry.AssetID
Where
tblRegistry.Regkey =
'HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{28B89EEF-0028-0409-0100-CF3F3A09B77D}' And tblRegistry.Valuename = 'DisplayName' And tblRegistry.Value = 'DWG TrueView 2017 - English' And tblAssets.Lastseen <> '') And tblOperatingsystem.Caption = 'Microsoft Windows 7 Professional' And tblAssets.IPNumeric > 192168113000 And tblAssets.IPNumeric < 192168113255)
Order By tblAssets.AssetID
1 REPLY 1
support_ict
Engaged Sweeper
After lots of trial and error, i've got it working.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now