‎06-04-2020 12:49 PM
Solved! Go to Solution.
‎06-10-2020 09:41 AM
Select Top 1000000 tsysOS.OSname As OS,
Case
When tsysOS.OScode Like '10.0.17134%' Then '1803'
When tsysOS.OScode Like '10.0.17763%' Then '1809'
When tsysOS.OScode Like '10.0.18362%' Then '1903'
When tsysOS.OScode Like '10.0.18363%' Then '1909'
Else '?'
End As Version,
Count(tblAssets.AssetID) As [Total Assets],
Query1.HotFixID,
Query1.Totals
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join (Select Top 1000000 tsysOS.OSname As OS,
Count(tblAssets.AssetID) As Totals,
tblQuickFixEngineeringUni.HotFixID,
tsysOS.OScode
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType =
tblAssets.Assettype
Inner Join tblOperatingsystem On tblAssets.AssetID =
tblOperatingsystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblQuickFixEngineering On tblAssets.AssetID =
tblQuickFixEngineering.AssetID
Inner Join tblQuickFixEngineeringUni On tblQuickFixEngineeringUni.QFEID
= tblQuickFixEngineering.QFEID
Where (tblQuickFixEngineeringUni.HotFixID = 'KB4556836' And
tblAssetCustom.State = 1) Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556843') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556846') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556853') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556813') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556807') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4551853') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556799')
Group By tsysOS.OSname,
tblQuickFixEngineeringUni.HotFixID,
tsysOS.OScode) Query1 On Query1.OScode = tblAssets.OScode
Where tblAssetCustom.State = 1
Group By tsysOS.OSname,
Query1.HotFixID,
Query1.Totals,
tsysOS.OScode
Order By OS
‎06-10-2020 12:16 PM
‎06-10-2020 09:41 AM
Select Top 1000000 tsysOS.OSname As OS,
Case
When tsysOS.OScode Like '10.0.17134%' Then '1803'
When tsysOS.OScode Like '10.0.17763%' Then '1809'
When tsysOS.OScode Like '10.0.18362%' Then '1903'
When tsysOS.OScode Like '10.0.18363%' Then '1909'
Else '?'
End As Version,
Count(tblAssets.AssetID) As [Total Assets],
Query1.HotFixID,
Query1.Totals
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join (Select Top 1000000 tsysOS.OSname As OS,
Count(tblAssets.AssetID) As Totals,
tblQuickFixEngineeringUni.HotFixID,
tsysOS.OScode
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType =
tblAssets.Assettype
Inner Join tblOperatingsystem On tblAssets.AssetID =
tblOperatingsystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblQuickFixEngineering On tblAssets.AssetID =
tblQuickFixEngineering.AssetID
Inner Join tblQuickFixEngineeringUni On tblQuickFixEngineeringUni.QFEID
= tblQuickFixEngineering.QFEID
Where (tblQuickFixEngineeringUni.HotFixID = 'KB4556836' And
tblAssetCustom.State = 1) Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556843') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556846') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556853') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556813') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556807') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4551853') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556799')
Group By tsysOS.OSname,
tblQuickFixEngineeringUni.HotFixID,
tsysOS.OScode) Query1 On Query1.OScode = tblAssets.OScode
Where tblAssetCustom.State = 1
Group By tsysOS.OSname,
Query1.HotFixID,
Query1.Totals,
tsysOS.OScode
Order By OS
‎06-09-2020 07:04 PM
‎06-09-2020 03:40 PM
Select Top 1000000 tsysOS.OSname As OS,
Case
When tsysOS.OScode Like '10.0.17134%' Then '1803'
When tsysOS.OScode Like '10.0.17763%' Then '1809'
When tsysOS.OScode Like '10.0.18362%' Then '1903'
When tsysOS.OScode Like '10.0.18363%' Then '1909'
Else '?'
End As Version,
Count(Case
When tsysOS.OSname = 'Win 7' Then 'null'
When tsysOS.OSname = 'Win 2008 R2' Then 'null'
When tsysOS.OSname = 'Win 8.1' Then 'null'
When tsysOS.OSname = 'Win 2012 R2' Then 'null'
When tsysOS.OSname = 'Win 2016' Then 'null'
When tsysOS.OScode Like '10.0.17134' Then 'null'
When tsysOS.OScode Like '10.0.17763' Then 'null'
When tsysOS.OScode Like '10.0.18362' Then 'null'
When tsysOS.OScode Like '10.0.18363' Then 'null'
When tsysOS.OSname = 'Win 2019' Then 'null'
End) As Completed,
tblQuickFixEngineeringUni.HotFixID,
Query1.[Total Assets]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblQuickFixEngineering On
tblAssets.AssetID = tblQuickFixEngineering.AssetID
Inner Join tblQuickFixEngineeringUni On tblQuickFixEngineeringUni.QFEID =
tblQuickFixEngineering.QFEID
Inner Join (Select Top 1000000 tsysOS.OSname,
Count(tblAssets.AssetID) As [Total Assets],
tblOperatingsystem.Version,
tsysOS.OScode
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblOperatingsystem On tblAssets.AssetID =
tblOperatingsystem.AssetID
Where tblAssetCustom.State = 1 And tblAssets.Assettype = -1
Group By tsysOS.OSname,
tblOperatingsystem.Version,
tsysOS.OScode
Order By [Total Assets] Desc) Query1 On Query1.OScode = tsysOS.OScode
Where (tblQuickFixEngineeringUni.HotFixID = 'KB4556836' And
tblAssetCustom.State = 1) Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556843') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556846') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556853') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556813') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556807') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4551853') Or
(tblQuickFixEngineeringUni.HotFixID = 'KB4556799')
Group By tsysOS.OSname,
tblQuickFixEngineeringUni.HotFixID,
tsysOS.OScode,
Query1.[Total Assets]
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now