‎05-23-2016 05:55 PM
Select Top 1000000 *
From (Select tblAssets.AssetID,
tblAssets_1.AssetName As [Asset-User],
tsysAssetRelationTypes.RelationTypeIcon10 As icon,
tblAssetRelations.StartDate,
tsysAssetRelationTypes.Name As RelationType,
tblAssets.AssetName,
tblAssetRelations.Comments
From tblAssets
Inner Join tblAssetRelations
On tblAssets.AssetID = tblAssetRelations.ParentAssetID
Inner Join tsysAssetRelationTypes On tblAssetRelations.Type =
tsysAssetRelationTypes.RelationTypeID
Inner Join tblAssets tblAssets_1 On tblAssetRelations.ChildAssetID =
tblAssets_1.AssetID
Where tblAssets_1.AssetName Like 'RSA SecurID-%'
Union
Select tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetRelationTypes.RelationTypeIcon10 As icon,
tblAssetUserRelations.StartDate,
tsysAssetRelationTypes.Name As RelationType,
tblADusers.Name As [Asset-User],
tblAssetUserRelations.Comments
From tblAssets
Inner Join tblAssetUserRelations On tblAssets.AssetID =
tblAssetUserRelations.AssetID
Inner Join tblADusers On tblAssetUserRelations.Username =
tblADusers.Username And tblAssetUserRelations.Userdomain =
tblADusers.Userdomain
Inner Join tsysAssetRelationTypes On tblAssetUserRelations.Type =
tsysAssetRelationTypes.RelationTypeID) As tbl
Order By tbl.AssetName,
tbl.RelationType
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now