cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tallpr24
Engaged Sweeper
how can i get a report for everything found on subnet 172.16.14.1-172.16.14.255 ?
2 REPLIES 2
prighi61
Engaged Sweeper III
Hi Brandon, be aware that the "Between .. and .." clause doesn't work correctly in this case as the lexicographic order will exclude '172.16.14.3*', .. '172.16.14.9*'.
you'd better use "like '172.16.14.%'".
brandon_jones
Champion Sweeper III
This should work.

Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Description,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.SP As SP,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Where tblAssets.IPAddress Between '172.16.14.1' And '172.16.14.255' And
tblAssetCustom.State = 1
Order By tblAssets.IPNumeric