‎06-11-2019 04:29 AM
‎07-09-2019 09:46 AM
‎06-12-2019 04:36 PM
‎06-11-2019 09:42 AM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname As OS,
tblAssets.OScode + '.' + tblAssets.BuildNumber As Build,
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
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tblAssets.LocationID = tsysIPLocations.LocationID
Where tsysOS.OSname = 'Win 10' And tblAssetCustom.State = 1 And
tblAssets.BuildNumber Is Not Null And
(Cast(Replace(Replace(Replace(tblAssets.OScode, '.', ''), 'S', ''), 'R',
'') As int) Not In (Select Max(Cast(Replace(Replace(tsysOS.OScode, '.', ''),
'S', '') As int)) From tsysOS
Where tsysOS.Sortorder = 18) Or tblAssets.BuildNumber Not In (Select
Max(Cast(tblAssets.BuildNumber As Int)) From tblAssets
Where Cast(Replace(Replace(Replace(tblAssets.OScode, '.', ''), 'S', ''),
'R', '') As int) In (Select Max(Cast(Replace(Replace(tsysOS.OScode,
'.', ''), 'S', '') As int)) From tsysOS
Where tsysOS.Sortorder = 18)))
Order By tblAssets.AssetName
‎08-07-2019 02:28 PM
Esben.D wrote:
If I'm not mistaken it searches for the highest build number scanned and compares the rest to that.
Try running the report below and see if that works. If I remember correctly there was an issue with the built-in report where it compared strings instead of converting the data to a number first.Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname As OS,
tblAssets.OScode + '.' + tblAssets.BuildNumber As Build,
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
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tblAssets.LocationID = tsysIPLocations.LocationID
Where tsysOS.OSname = 'Win 10' And tblAssetCustom.State = 1 And
tblAssets.BuildNumber Is Not Null And
(Cast(Replace(Replace(Replace(tblAssets.OScode, '.', ''), 'S', ''), 'R',
'') As int) Not In (Select Max(Cast(Replace(Replace(tsysOS.OScode, '.', ''),
'S', '') As int)) From tsysOS
Where tsysOS.Sortorder = 18) Or tblAssets.BuildNumber Not In (Select
Max(Cast(tblAssets.BuildNumber As Int)) From tblAssets
Where Cast(Replace(Replace(Replace(tblAssets.OScode, '.', ''), 'S', ''),
'R', '') As int) In (Select Max(Cast(Replace(Replace(tsysOS.OScode,
'.', ''), 'S', '') As int)) From tsysOS
Where tsysOS.Sortorder = 18)))
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now