‎07-27-2015 04:49 AM
Solved! Go to Solution.
‎07-27-2015 01:00 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username As [last logged on user],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select tblCPlogoninfoDistinct.AssetID,
Count(tblCPlogoninfoDistinct.Username) As [number users]
From (Select Distinct tblCPlogoninfo.AssetID,
tblCPlogoninfo.Username
From tblCPlogoninfo
Where tblCPlogoninfo.logontime > GetDate() - 30) tblCPlogoninfoDistinct
Group By tblCPlogoninfoDistinct.AssetID
Having Count(tblCPlogoninfoDistinct.Username) > 1) tCPlogoninfo
On tblAssets.AssetID = tCPlogoninfo.AssetID
Where tblAssetCustom.State = 1
Order By tblAssets.AssetName
‎07-27-2015 01:00 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username As [last logged on user],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select tblCPlogoninfoDistinct.AssetID,
Count(tblCPlogoninfoDistinct.Username) As [number users]
From (Select Distinct tblCPlogoninfo.AssetID,
tblCPlogoninfo.Username
From tblCPlogoninfo
Where tblCPlogoninfo.logontime > GetDate() - 30) tblCPlogoninfoDistinct
Group By tblCPlogoninfoDistinct.AssetID
Having Count(tblCPlogoninfoDistinct.Username) > 1) tCPlogoninfo
On tblAssets.AssetID = tCPlogoninfo.AssetID
Where tblAssetCustom.State = 1
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now