cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Cieran
Engaged Sweeper II
Hi Guys

I have a report that finds all of are mobile phones and how a Sim card is related to them, I.E Housed IN, how can i also get the report to show devices that have no asset relations?

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename As AssetType,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tsysIPLocations.IPLocation,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssets.Lastseen,
tsysAssetRelationTypes.ReverseName As RelationType,
tblAssetRelations.StartDate As RelationStartDate,
ChildAsset.AssetName As ChildAsset,
ChildAsset.AssetTypename As ChildAssetType,
tblAssetUserRelations.Username As RelationUser,
tblAssets.Description,
tsysAssetRelationTypes.Name,
tblAssetCustom.State
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblState On tblState.State = tblAssetCustom.State
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblAssetRelations On
tblAssets.AssetID = tblAssetRelations.ParentAssetID
Inner Join tsysAssetRelationTypes On tblAssetRelations.Type =
tsysAssetRelationTypes.RelationTypeID
Inner Join (Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tblAssets.IPAddress
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType =
tblAssets.Assettype
Where tblAssetCustom.State = 1) As ChildAsset On
tblAssetRelations.ChildAssetID = ChildAsset.AssetID
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join tblMacOSInfo On tblAssets.AssetID = tblMacOSInfo.AssetID
Left Join tblLinuxSystem On tblAssets.AssetID = tblLinuxSystem.AssetID
Inner Join tblAssetUserRelations On
tblAssets.AssetID = tblAssetUserRelations.AssetID
Where ((tsysAssetTypes.AssetTypename = 'Mobile phone' Or
tsysAssetTypes.AssetTypename = 'iPhone') And tblAssetCustom.State = 1) Or
(tblAssetCustom.State = 0)

Thanks

Cieran Paice
0 REPLIES 0

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now