‎11-20-2014 11:03 AM
SELECT
TOP 1000000 tsysAssetTypes.AssetTypename,
COUNT(tblAssets.AssetID) AS Total
FROM tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tblAssets.Assettype = tsysAssetTypes.AssetType
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblState.Statename = 'Active'
GROUP BY tsysAssetTypes.AssetTypename
ORDER BY total DESC
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now