Hi all, I've recently purchased Lansweeper and it seems pretty good.
I've created a new report which lists our company mobile assets, along with serial number etc. I have custom asset relations configured so I can use it as a "check out" and "check in" system and therefore see the check in/check out history for each device.
The issue I'm having is that each asset is showing multiple times if it has more than one relation attached
Here's the SQL
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename As [Asset Type],
tsysAssetTypes.AssetTypeIcon16 As icon,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber As [Serial/IMEI No.],
tblAssetCustom.Custom2 As [Phone No.],
tblAssetCustom.PurchaseDate As [Purchase Date],
tblAssetCustom.Warrantydate As [Warranty Expiry],
tsysAssetRelationTypes.Name As Relationships,
tblAssetUserRelations.Username As [User],
tblAssetUserRelations.Comments As Comments
From tblAssets
Left Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblAssetUserRelations
On tblAssets.AssetID = tblAssetUserRelations.AssetID
Left Join tblAssetRelations
On tblAssets.AssetID = tblAssetRelations.ParentAssetID And
tblAssetUserRelations.RelationID = tblAssetRelations.RelationID
Left Join tsysAssetRelationTypes On tblAssetUserRelations.Type =
tsysAssetRelationTypes.RelationTypeID
Where tsysAssetTypes.AssetTypename = 'Mobile Phone' And tblAssetCustom.State = 1
Order By tblAssets.AssetName
I've tried SELECT DISTINCT but even the duplicate row is not distinct as the Relationships and User are different
Could anyone help?
Thanks in advance