Select Top 1000000
DatePart(yyyy, tblBIOS.ReleaseDate) As Biosyear,
Count(tblAssets.AssetID) As Total
From
tblAssets
Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Where
tblAssetCustom.State = 1
Group By
DatePart(yyyy, tblBIOS.ReleaseDate)
Order By
Biosyear
Select from all assets (
tblAssets)
For all active assets (
tblAssetCustom.State = 1)
Select the year from BIOS release date for each asset (
tblBIOS.ReleaseDate)
Count the number of each year
Sort the results by year
tblBIOS is filled with data retrieved from Windows, so no non-Windows computers will have any BIOS data in there, nor will any other assets such as monitors and printers. By doing an INNER JOIN against
tblBIOS, then, the results are automatically filtered for only Windows assets, so you don't need to explicitly filter for asset type "Windows".