‎02-26-2020 05:08 PM
‎02-26-2020 10:00 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename As [Phone Type],
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Custom2 As Carrier,
tblAssetCustom.Custom3 As [Phone Num],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Full Join (Select Top 100000 tblAssetUserRelations.RelationID,
tblAssetUserRelations.AssetID,
tblAssetUserRelations.EndDate
From tblAssetUserRelations
Where tblAssetUserRelations.EndDate Is Not Null) SubTest1 On
tblAssets.AssetID = SubTest1.AssetID
Where tsysAssetTypes.AssetTypename = 'iPhone' And tblAssetCustom.State = 1 And
(Select COUNT(*) From tblAssetUserRelations
Where tblAssetUserRelations.AssetID = tblAssets.AssetID And
tblAssetUserRelations.EndDate Is Null) < 1
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now