02-28-2017 04:18 PM
Solved! Go to Solution.
03-01-2017 10:29 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName As [Child Asset],
tsysAssetTypes.AssetTypename,
tsysAssetRelationTypes.Name As [Asset relation type],
tblAssets1.AssetName As [Parent Asset],
tblADComputers.OU As [Parent Asset OU],
tsysAssetRelationTypes1.Name As [User relation type],
tblAssetUserRelations.Username,
tblADusers.OU As [User OU]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblAssetRelations
On tblAssets.AssetID = tblAssetRelations.ChildAssetID
Inner Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblAssetRelations.ParentAssetID
Inner Join tsysAssetRelationTypes On tblAssetRelations.Type =
tsysAssetRelationTypes.RelationTypeID
Inner Join tblAssetUserRelations On tblAssets.AssetID =
tblAssetUserRelations.AssetID
Inner Join tblADusers On tblADusers.Username = tblAssetUserRelations.Username
And tblADusers.Userdomain = tblAssetUserRelations.Userdomain
Inner Join tsysAssetRelationTypes tsysAssetRelationTypes1
On tblAssetUserRelations.Type = tsysAssetRelationTypes1.RelationTypeID
Inner Join tblADComputers On tblAssets1.AssetID = tblADComputers.AssetID
Where tsysAssetTypes.AssetTypename = 'Headset '
Order By [Child Asset],
tblAssetUserRelations.Username
03-01-2017 10:29 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName As [Child Asset],
tsysAssetTypes.AssetTypename,
tsysAssetRelationTypes.Name As [Asset relation type],
tblAssets1.AssetName As [Parent Asset],
tblADComputers.OU As [Parent Asset OU],
tsysAssetRelationTypes1.Name As [User relation type],
tblAssetUserRelations.Username,
tblADusers.OU As [User OU]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblAssetRelations
On tblAssets.AssetID = tblAssetRelations.ChildAssetID
Inner Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblAssetRelations.ParentAssetID
Inner Join tsysAssetRelationTypes On tblAssetRelations.Type =
tsysAssetRelationTypes.RelationTypeID
Inner Join tblAssetUserRelations On tblAssets.AssetID =
tblAssetUserRelations.AssetID
Inner Join tblADusers On tblADusers.Username = tblAssetUserRelations.Username
And tblADusers.Userdomain = tblAssetUserRelations.Userdomain
Inner Join tsysAssetRelationTypes tsysAssetRelationTypes1
On tblAssetUserRelations.Type = tsysAssetRelationTypes1.RelationTypeID
Inner Join tblADComputers On tblAssets1.AssetID = tblADComputers.AssetID
Where tsysAssetTypes.AssetTypename = 'Headset '
Order By [Child Asset],
tblAssetUserRelations.Username
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now