‎11-18-2013 08:04 PM
‎11-19-2013 03:46 PM
‎11-19-2013 09:27 AM
select * from (SELECT tblAssets.AssetID, tblAssets.AssetName,
tsysAssetRelationTypes.RelationTypeIcon10 AS icon,tblAssetRelations.StartDate,
tsysAssetRelationTypes.Name AS RelationType, tblAssets_1.AssetName AS [Asset-User],
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
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 AssetName, relationtype
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now