→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎04-27-2022 04:59 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Model,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblPrinters.Caption As Printer,
tblPrinters.Portname As PrinterPort,
tblPrinters.Lastchanged
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblPrinters On tblAssets.AssetID = tblPrinters.AssetID
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblAssets.IPAddress Like '10.40.12.%' And tblPrinters.Caption Not Like
'PRINTERNAME'
Order By tblAssets.Domain,
tblAssets.AssetName,
Printer
‎04-27-2022 11:09 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Case
When Printer.AssetID Is Not Null Then 'Yes'
Else 'No'
End As 'Printer installed',
tblAssets.Domain,
tblAssets.Username,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Model,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join (Select tblPrinters.Lastchanged,
tblPrinters.Portname,
tblPrinters.Caption,
tblPrinters.AssetID
From lansweeperdb.dbo.tblPrinters
Where tblPrinters.Caption Like '%PRINTERNAME%') Printer On Printer.AssetID =
tblAssets.AssetID
Where Case
When Printer.AssetID Is Not Null Then 'Yes'
Else 'No'
End = 'No' And tblAssets.IPAddress Like '10.40.12.%' And tblAssetCustom.State = 1
And tsysAssetTypes.AssetTypename In ('Windows')
Order By tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now