cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joey_khoury
Engaged Sweeper II
Hello, I'm new to LS and I'm running the trial version right now (want to buy it...BIG TIME!).

I've modified the built in report which searches for assets for with a particular amount of RAM. The report I have gives me All Assets (computers/servers) with exactly 2GB, this is the code:
================================================================================
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tblAssets.Description,
tsysOS.OSname,
tblAssets.Memory,
tblAssetCustom.Model,
tblAssets.Lastseen,
tsysOS.Image As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblAssets.Memory = '2048' And tblAssetCustom.State = 1
Order By tblAssets.AssetName
================================================================================

I want to modify the report so the IP Location of the asset is also displayed in the results. Can someone kindly assist?
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
try this

SELECT TOP 1000000 tblAssets.AssetID, tblAssets.AssetUnique, tblAssets.Domain, tblAssets.Description, tsysOS.OSname,
tblAssets.Memory, tblAssetCustom.Model, tblAssets.Lastseen, tsysOS.Image AS icon, tblAssets.AssetID AS Expr1,
tsysIPLocations.IPLocation
FROM tblAssets LEFT OUTER JOIN
tsysIPLocations ON tblAssets.IPNumeric >= tsysIPLocations.StartIP AND
tblAssets.IPNumeric <= tsysIPLocations.EndIP INNER JOIN
tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID INNER JOIN
tsysOS ON tblAssets.OScode = tsysOS.OScode
WHERE (tblAssets.Memory = '2048') AND (tblAssetCustom.State = 1)
ORDER BY tblAssets.AssetName

View solution in original post

1 REPLY 1
Hemoco
Lansweeper Alumni
try this

SELECT TOP 1000000 tblAssets.AssetID, tblAssets.AssetUnique, tblAssets.Domain, tblAssets.Description, tsysOS.OSname,
tblAssets.Memory, tblAssetCustom.Model, tblAssets.Lastseen, tsysOS.Image AS icon, tblAssets.AssetID AS Expr1,
tsysIPLocations.IPLocation
FROM tblAssets LEFT OUTER JOIN
tsysIPLocations ON tblAssets.IPNumeric >= tsysIPLocations.StartIP AND
tblAssets.IPNumeric <= tsysIPLocations.EndIP INNER JOIN
tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID INNER JOIN
tsysOS ON tblAssets.OScode = tsysOS.OScode
WHERE (tblAssets.Memory = '2048') AND (tblAssetCustom.State = 1)
ORDER BY tblAssets.AssetName