‎07-29-2011 01:48 AM
Solved! Go to Solution.
‎08-02-2011 01:08 PM
Select tblComputers.Computername, tblComputers.ComputerUnique,
tblComputers.Domain, tblComputers.Userdomain, tblComputers.Username,
tblADusers.Displayname, Topuser.Domain As TopDomain, Topuser.Username As
TopUsername, tblADusers1.Displayname As TopDisplayname, Topuser.Total
From tblComputers Left Join
tblADusers On tblADusers.Username = tblComputers.Username And
tblADusers.Userdomain = tblComputers.Userdomain Left Join
(Select Top 1 tblCPlogoninfo.Domain, tblCPlogoninfo.Username,
Count(tblCPlogoninfo.ID) As Total
From tblCPlogoninfo
Group By tblCPlogoninfo.Domain, tblCPlogoninfo.Username
Order By Count(tblCPlogoninfo.ID) Desc) Topuser On Topuser.Domain =
tblComputers.Userdomain And Topuser.Username = tblComputers.Username
Left Join
tblADusers tblADusers1 On tblADusers1.Username = Topuser.Username And
tblADusers1.Userdomain = Topuser.Domain
‎11-10-2011 10:55 PM
‎08-02-2011 01:08 PM
Select tblComputers.Computername, tblComputers.ComputerUnique,
tblComputers.Domain, tblComputers.Userdomain, tblComputers.Username,
tblADusers.Displayname, Topuser.Domain As TopDomain, Topuser.Username As
TopUsername, tblADusers1.Displayname As TopDisplayname, Topuser.Total
From tblComputers Left Join
tblADusers On tblADusers.Username = tblComputers.Username And
tblADusers.Userdomain = tblComputers.Userdomain Left Join
(Select Top 1 tblCPlogoninfo.Domain, tblCPlogoninfo.Username,
Count(tblCPlogoninfo.ID) As Total
From tblCPlogoninfo
Group By tblCPlogoninfo.Domain, tblCPlogoninfo.Username
Order By Count(tblCPlogoninfo.ID) Desc) Topuser On Topuser.Domain =
tblComputers.Userdomain And Topuser.Username = tblComputers.Username
Left Join
tblADusers tblADusers1 On tblADusers1.Username = Topuser.Username And
tblADusers1.Userdomain = Topuser.Domain
‎07-30-2011 06:21 AM
‎07-29-2011 06:22 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now