→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !
‎01-19-2022 12:03 PM
‎02-07-2022 06:56 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname As OS,
tblAssets.OScode + '.' + Right('0000' + tblAssets.BuildNumber, 4) As Build,
Case
When tblAssets.Version = '21H2' Then tblAssets.OScode + '.' + TwoOneHTwo.MaxBuild
When tblAssets.Version = '21H1' Then tblAssets.OScode + '.' + TwoOneHOne.MaxBuild
When tblAssets.Version = '20H2' Then tblAssets.OScode + '.' + TwoZeroHTwo.MaxBuild
Else 'Out of Support'
End As HighestBuild,
tblAssets.Version As [OS Version],
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Description,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tblAssets.Firstseen,
tblAssets.Lastseen,
Case
When tblAssets.Version = '21H2' And tblAssets.BuildNumber = TwoOneHTwo.MaxBuild Then 'black'
When tblAssets.Version = '21H1' And tblAssets.BuildNumber = TwoOneHOne.MaxBuild Then 'black'
When tblAssets.Version = '20H2' And tblAssets.BuildNumber = TwoZeroHTwo.MaxBuild Then 'black'
Else 'red'
End As foregroundcolor
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Outer Join tsysIPLocations On tblAssets.LocationID =
tsysIPLocations.LocationID
Left Join (Select Top 1 With Ties tsysOS_1.OSname,
Right('0000' + tblAssets_1.BuildNumber, 4) As MaxBuild
From tblAssets As tblAssets_1
Inner Join tsysOS As tsysOS_1 On tsysOS_1.OScode = tblAssets_1.OScode
Where tsysOS_1.OSname = 'Win 10' And tblAssets_1.Version = '21H2'
Group By tsysOS_1.OSname,
Right('0000' + tblAssets_1.BuildNumber, 4)
Order By Row_Number() Over (Partition By tsysOS_1.OSname Order By
Right('0000' + tblAssets_1.BuildNumber, 4) Desc)) As TwoOneHTwo On
tsysOS.OSname = TwoOneHTwo.OSname
Left Join (Select Top 1 With Ties tsysOS_2.OSname,
Right('0000' + tblAssets_2.BuildNumber, 4) As MaxBuild
From tblAssets As tblAssets_2
Inner Join tsysOS As tsysOS_2 On tsysOS_2.OScode = tblAssets_2.OScode
Where tsysOS_2.OSname = 'Win 10' And tblAssets_2.Version = '21H1'
Group By tsysOS_2.OSname,
Right('0000' + tblAssets_2.BuildNumber, 4)
Order By Row_Number() Over (Partition By tsysOS_2.OSname Order By
Right('0000' + tblAssets_2.BuildNumber, 4) Desc)) As TwoOneHOne On
tsysOS.OSname = TwoOneHOne.OSname
Left Join (Select Top 1 With Ties tsysOS_3.OSname,
Right('0000' + tblAssets_3.BuildNumber, 4) As MaxBuild
From tblAssets As tblAssets_3
Inner Join tsysOS As tsysOS_3 On tsysOS_3.OScode = tblAssets_3.OScode
Where tsysOS_3.OSname = 'Win 10' And tblAssets_3.Version = '20H2'
Group By tsysOS_3.OSname,
Right('0000' + tblAssets_3.BuildNumber, 4)
Order By Row_Number() Over (Partition By tsysOS_3.OSname Order By
Right('0000' + tblAssets_3.BuildNumber, 4) Desc)) As TwoZeroHTwo On
tsysOS.OSname = TwoZeroHTwo.OSname
Where tblAssetCustom.State = 1
Order By [OS Version] Desc, Build Desc,
tblAssets.AssetName
‎02-02-2022 10:24 PM
Select Top 1000000 os1.OSCodeNumeric,
os1.OSname,
os1.OScode,
os1.Sortorder
From tsysOS As os1
‎01-26-2022 04:14 PM
‎01-25-2022 09:02 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now