cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chads
Lansweeper Alumni
Used this code from another post i found and it is working great but i can't figure out how to put the Full User name next to the username. i am not good at SQL so any help is appreciated. the code is below. if anyone could post new code would be great.

Select Top 1000000 tsysOS.Image As Icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Description,
TsysChassisTypes.ChassisName,
tsysOS.OSname,
tblAssets.SP,
tblAssets.IPAddress,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Lastseen
From tblAssets
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Inner Join TsysChassisTypes On TsysChassisTypes.Chassistype =
tblSystemEnclosure.ChassisTypes
Where (tblSystemEnclosure.ChassisTypes = 😎 Or
(tblSystemEnclosure.ChassisTypes = 10) Or
(tblSystemEnclosure.ChassisTypes = 9)
Order By tblAssets.AssetUnique
1 ACCEPTED SOLUTION
RCorbeil
Honored Sweeper II
Add a link to tblADUsers. That table uses both the UserDomain and UserName together as a key.
  INNER JOIN tblADusers ON tblAssets.Userdomain = tblADusers.Userdomain
AND tblAssets.Username = tblADusers.Username

Once that table is linked, you should be able to add the field tblADUsers.Name to the report.

View solution in original post

1 REPLY 1
RCorbeil
Honored Sweeper II
Add a link to tblADUsers. That table uses both the UserDomain and UserName together as a key.
  INNER JOIN tblADusers ON tblAssets.Userdomain = tblADusers.Userdomain
AND tblAssets.Username = tblADusers.Username

Once that table is linked, you should be able to add the field tblADUsers.Name to the report.