‎11-18-2014 04:29 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.Username,
tblAssets.Userdomain,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
Coalesce(tsysOS.OSname, tblMacOSInfo.SystemVersion, tblLinuxSystem.OSRelease)
As OS,
tblAssets.SP,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.Serialnumber
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblState On tblState.State = tblAssetCustom.State
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join tblMacOSInfo On tblAssets.AssetID = tblMacOSInfo.AssetID
Left Join tblLinuxSystem On tblAssets.AssetID = tblLinuxSystem.AssetID
Inner Join (Select Count(tblAssetCustom.AssetID) As Total,
Coalesce(tblAssetCustom.Serialnumber, N'') As Serial
From tblAssetCustom
Where tblAssetCustom.State = 1
Group By Coalesce(tblAssetCustom.Serialnumber, N'')
Having Count(tblAssetCustom.AssetID) > 1 And
Coalesce(tblAssetCustom.Serialnumber, N'') <> '') As Duplicates
On tblAssetCustom.Serialnumber = Duplicates.Serial
Where tblState.Statename = 'Active'
Order By tblAssets.IPNumeric,
tblAssets.Domain,
tblAssets.AssetName
‎08-05-2020 02:28 PM
Where tblState.Statename = 'Active'
Where tblState.Statename <> 'Junk'
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now