→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎03-05-2015 08:15 PM
Solved! Go to Solution.
‎03-09-2015 03:18 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Description,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetUserRelations.Username,
tblAssetCustom.Serialnumber,
tblAssetUserRelations.StartDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join (Select Max(tblAssetUserRelations.StartDate) As StartDate,
tblAssetUserRelations.AssetID,
tblAssetUserRelations.Type
From tblAssetUserRelations
Group By tblAssetUserRelations.AssetID,
tblAssetUserRelations.Type) tAssetUser On tblAssets.AssetID =
tAssetUser.AssetID
Inner Join tblAssetUserRelations On tAssetUser.AssetID =
tblAssetUserRelations.AssetID And tAssetUser.StartDate =
tblAssetUserRelations.StartDate
Inner Join tsysAssetRelationTypes
On tAssetUser.Type = tsysAssetRelationTypes.RelationTypeID
Inner Join tblADusers On tblADusers.Username = tblAssetUserRelations.Username
And tblADusers.Userdomain = tblAssetUserRelations.Userdomain
Where tsysAssetTypes.AssetTypename = 'Headset' And tsysAssetRelationTypes.Name =
'used by' And tblAssetCustom.State = 1
‎03-09-2015 03:18 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Description,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetUserRelations.Username,
tblAssetCustom.Serialnumber,
tblAssetUserRelations.StartDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join (Select Max(tblAssetUserRelations.StartDate) As StartDate,
tblAssetUserRelations.AssetID,
tblAssetUserRelations.Type
From tblAssetUserRelations
Group By tblAssetUserRelations.AssetID,
tblAssetUserRelations.Type) tAssetUser On tblAssets.AssetID =
tAssetUser.AssetID
Inner Join tblAssetUserRelations On tAssetUser.AssetID =
tblAssetUserRelations.AssetID And tAssetUser.StartDate =
tblAssetUserRelations.StartDate
Inner Join tsysAssetRelationTypes
On tAssetUser.Type = tsysAssetRelationTypes.RelationTypeID
Inner Join tblADusers On tblADusers.Username = tblAssetUserRelations.Username
And tblADusers.Userdomain = tblAssetUserRelations.Userdomain
Where tsysAssetTypes.AssetTypename = 'Headset' And tsysAssetRelationTypes.Name =
'used by' And tblAssetCustom.State = 1
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now