‎11-20-2014 11:11 AM
Select Top 1000000 Case When Len(tblSoftwareUni.SoftwarePublisher) = 0 Or
tblSoftwareUni.SoftwarePublisher Is Null Then 'Unknown'
Else tblSoftwareUni.SoftwarePublisher End As Publisher,
Count(tblAssets.AssetID) As Total
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Where tblState.Statename = 'Active'
Group By (Case When Len(tblSoftwareUni.SoftwarePublisher) = 0 Or
tblSoftwareUni.SoftwarePublisher Is Null Then 'Unknown'
Else tblSoftwareUni.SoftwarePublisher End)
Order By Total Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now