‎09-19-2018 05:50 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Custom5 As [System/Env],
Coalesce(tblNetwork.IPAddress, tblLinuxNetworkDetection.Ipv4,
tblAssets.IPAddress) As [All IP Addresses],
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Left Join tblLinuxNetworkDetection On tblAssets.AssetID =
tblLinuxNetworkDetection.AssetID
Left Join tsysIPLocations On tsysIPLocations.LocationID = tblAssets.LocationID
Where (tblAssets.IPAddress Is Not Null And Coalesce(tblNetwork.IPAddress,
tblLinuxNetworkDetection.Ipv4, tblAssets.IPAddress) Like '%5.5.%'
And tblAssetCustom.State = 1) Or
(tblAssets.IPAddress Is Not Null And Coalesce(tblNetwork.IPAddress,
tblLinuxNetworkDetection.Ipv4, tblAssets.IPAddress) Is Null And
tblAssetCustom.State = 1)
Solved! Go to Solution.
‎09-24-2018 08:54 PM
Select Top 1000000 TableResults.AssetID,
TableResults.AssetName,
TableResults.AssetTypename,
TableResults.[System/Env],
TableResults.IPLocation,
Max(TableResults.[All IP Addresses]) As [All IP Addresses],
TableResults.icon
From (Select tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Custom5 As [System/Env],
Coalesce(tblNetwork.IPAddress, tblLinuxNetworkDetection.Ipv4,
tblAssets.IPAddress) As [All IP Addresses],
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Left Join tblLinuxNetworkDetection On tblAssets.AssetID =
tblLinuxNetworkDetection.AssetID
Left Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Where (tblAssets.IPAddress Is Not Null And Coalesce(tblNetwork.IPAddress,
tblLinuxNetworkDetection.Ipv4, tblAssets.IPAddress) Like '%5.5.%' And
tblAssetCustom.State = 1) Or
(tblAssets.IPAddress Is Not Null And Coalesce(tblNetwork.IPAddress,
tblLinuxNetworkDetection.Ipv4, tblAssets.IPAddress) Is Null And
tblAssetCustom.State = 1)) As TableResults
Group By TableResults.AssetID,
TableResults.AssetName,
TableResults.AssetTypename,
TableResults.[System/Env],
TableResults.IPLocation,
TableResults.icon,
TableResults.IPAddress
‎09-24-2018 08:54 PM
Select Top 1000000 TableResults.AssetID,
TableResults.AssetName,
TableResults.AssetTypename,
TableResults.[System/Env],
TableResults.IPLocation,
Max(TableResults.[All IP Addresses]) As [All IP Addresses],
TableResults.icon
From (Select tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Custom5 As [System/Env],
Coalesce(tblNetwork.IPAddress, tblLinuxNetworkDetection.Ipv4,
tblAssets.IPAddress) As [All IP Addresses],
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Left Join tblLinuxNetworkDetection On tblAssets.AssetID =
tblLinuxNetworkDetection.AssetID
Left Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Where (tblAssets.IPAddress Is Not Null And Coalesce(tblNetwork.IPAddress,
tblLinuxNetworkDetection.Ipv4, tblAssets.IPAddress) Like '%5.5.%' And
tblAssetCustom.State = 1) Or
(tblAssets.IPAddress Is Not Null And Coalesce(tblNetwork.IPAddress,
tblLinuxNetworkDetection.Ipv4, tblAssets.IPAddress) Is Null And
tblAssetCustom.State = 1)) As TableResults
Group By TableResults.AssetID,
TableResults.AssetName,
TableResults.AssetTypename,
TableResults.[System/Env],
TableResults.IPLocation,
TableResults.icon,
TableResults.IPAddress
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now