cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
atlzonlyplayer
Engaged Sweeper
Hi all, I am running a modified version of the "Software by computer" report to include several other fields. I was asked to include the number of cores in my report, but when I add the tblProcessors and include the cores, the results almost double. My code is below. Would anyone be willing to take a look and help me modify it so I can have the number of cores listed without having several duplicates.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblOperatingsystem.Caption,
tblAssets.Processor,
tblAssets.NrProcessors,
tblSoftwareUni.SoftwarePublisher As publisher,
tblSoftwareUni.softwareName As software,
tblSoftware.softwareVersion,
tsysOS.Image As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblProcessor.NumberOfCores
From tblSoftware
Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblProcessor On tblAssets.AssetID = tblProcessor.AssetID
Where (tblSoftwareUni.SoftwarePublisher Like '%Microsoft%' Or
tblSoftwareUni.SoftwarePublisher Like '%Citrix%') And tblAssetCustom.State =
1
Order By tblAssets.AssetName,
software
1 ACCEPTED SOLUTION
Susan_A
Lansweeper Alumni
What you are seeing is "normal". TblProcessor has one entry per asset and per processor. SQL displays each table record (e.g. processor) as one line. Machines with multiple processors will have multiple lines.

You can always add a Distinct to your Select statement (Select Distinct...) to have lines that look exactly the same only listed once, but depending on the situation this may give you incorrect results.

View solution in original post

1 REPLY 1
Susan_A
Lansweeper Alumni
What you are seeing is "normal". TblProcessor has one entry per asset and per processor. SQL displays each table record (e.g. processor) as one line. Machines with multiple processors will have multiple lines.

You can always add a Distinct to your Select statement (Select Distinct...) to have lines that look exactly the same only listed once, but depending on the situation this may give you incorrect results.

New to Lansweeper?

Try Lansweeper For Free

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

Try Now