‎04-06-2016 02:46 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblNetwork.IPAddress As [current IP],
tsysIPLocations.IPLocation As [current IP location],
tblNetworkhist.IPAddress As [recent IP],
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblNetworkhist On tblAssets.AssetID = tblNetworkhist.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Where tblNetworkhist.MACaddress = tblNetwork.MACaddress And
tblNetworkhist.IPAddress <> tblNetwork.IPAddress And tblAssetCustom.State = 1
And tblNetworkhist.IPEnabled = 1 And tblNetwork.IPEnabled = 1
Order By tblNetworkhist.Lastchanged Desc
Solved! Go to Solution.
‎04-17-2016 09:48 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress As [current IP],
tsysIPLocations.IPLocation As [current IP location],
tblAssets.Lastseen,
tblAssets.Lasttried,
tblNetworkHist.IPAddress As [IP change],
Max(tblNetworkHist.Lastchanged) As [IP change date]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblNetworkHist On tblAssets.AssetID = tblNetworkHist.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Where tblAssetCustom.State = 1 And tblNetworkHist.IPEnabled = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblNetworkHist.IPAddress
Order By [IP change date] Desc
‎04-17-2016 09:48 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress As [current IP],
tsysIPLocations.IPLocation As [current IP location],
tblAssets.Lastseen,
tblAssets.Lasttried,
tblNetworkHist.IPAddress As [IP change],
Max(tblNetworkHist.Lastchanged) As [IP change date]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblNetworkHist On tblAssets.AssetID = tblNetworkHist.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Where tblAssetCustom.State = 1 And tblNetworkHist.IPEnabled = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblNetworkHist.IPAddress
Order By [IP change date] Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now