→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
itadministratio
Engaged Sweeper
Hey! I'm trying to make a report that shows the following: AssetName, Model, Manufacturer, SerialNumber, SystemSKU, Description (from AD) and Last Login (Displayname). The problem is that it does not show MAC computers when Description and Displayname are included. What have I done wrong?

"
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssetCustom.Model,
tblAssetCustom.Manufacturer,
tblAssetCustom.Serialnumber,
tblAssetCustom.SystemSKU,
tblADComputers.Description,
tblADusers.Displayname
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADComputers.Description <> tblADusers.Displayname
Where (tblAssets.AssetName Like 'SUB%') Or
(tblAssets.AssetName Like 'SUS%')

"
1 ACCEPTED SOLUTION
RCorbeil
Honored Sweeper II
The descriptions of tblADUsers and tblADComputers in the database documentation are clear about their storing Windows-domain users' and computers' attributes. Try replacing the INNER JOINs on the tblADxxx tables LEFT JOINs.

View solution in original post

2 REPLIES 2
RCorbeil
Honored Sweeper II
The descriptions of tblADUsers and tblADComputers in the database documentation are clear about their storing Windows-domain users' and computers' attributes. Try replacing the INNER JOINs on the tblADxxx tables LEFT JOINs.
AZHockeyNut
Champion Sweeper III
start by removing the where clause. does that return data (it did for me)
then it is likely in your where condition (s)
If you can provide some examples of asset names you want in the report and some that you do not want in (they can be fake ones that met your criteria) then I can probably help you more.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now