cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
whiterice07
Engaged Sweeper II
So I've got a report that pulls PC assets already, and I just don't know enough about the reporting abilities of LanSweeper to be able to add phones to this. The PCs were pulled into LanSweeper automatically but the phones I input manually - I don't know if that makes a difference. Any help or guidance would be greatly appreciated!

This is my current report:

Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblComputersystem.Lastchanged,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Description,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.SP As SP,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate
From tblComputersystem
Inner Join tblAssets On tblComputersystem.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tsysIPLocations.StartIP <= tblAssets.IPNumeric
And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Where tblComputersystem.Domainrole < 2 And tblAssetCustom.State = 1
Order By tblAssets.AssetName
4 REPLIES 4
whiterice07
Engaged Sweeper II
Aha! That did it! Thank you!
Esben_D
Lansweeper Employee
Lansweeper Employee
What is the asset types of your phones in Lansweeper? Since you specifically said iPhones, I used that in the query. Since you're not seeing them I assume they have a different asset type.

Just change 'iPhone' to whatever asset type your assets have and it should work.
whiterice07
Engaged Sweeper II
Hmm, I created a report and copy+pasted your query below, but it did not return any cell phone assets, just PCs. I think part of the problem may be that I had to manually input the phones into Lansweeper, so they do not have IP addresses or OS types listed. The only data I was able to input was AssetName, Type, Manufacturer, Model.
Esben_D
Lansweeper Employee
Lansweeper Employee
This report below should work.

I added an extra table to be able to filter on assettype. Additionally I changed some joins to left or right to ensure that the iPhones are not filtered out.
Lastly I reworked the where clause.


Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblComputersystem.Lastchanged,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Description,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.SP As SP,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tsysAssetTypes.AssetTypename
From tblComputersystem
Right Join tblAssets On tblComputersystem.AssetID = tblAssets.AssetID
Left Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tsysIPLocations.StartIP <= tblAssets.IPNumeric
And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where (tsysAssetTypes.AssetTypename = 'Windows' And tblAssetCustom.State = 1 And
tblComputersystem.Domainrole < 2) Or
(tsysAssetTypes.AssetTypename = 'iPhone')
Order By tblAssets.AssetName