cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JZastow
Engaged Sweeper II

Report no longer working found a temp work around for now but would like to get this one working again to show what systems ore not on 8-2023 build.

Also what the command to put the code in a window with the copy link

error Conversion failed when converting the nvarchar value '19042.1110' to data type int.

Select Top (1000000) SQ.AssetID,
SQ.OS,
SQ.Build,
SQ.[OS Version],
SQ.Domain,
SQ.Username,
SQ.Userdomain,
SQ.IPAddress,
SQ.Description,
SQ.Manufacturer,
SQ.Model,
SQ.Location,
SQ.IPLocation,
SQ.Firstseen As [Created at],
SQ.Lastseen As [Last successful scan],
SQ.icon
From (Select 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,
(Select Case
When IsNumeric(Replace(Replace(Replace(tblAssets.OScode, '.', ''),
'S', ''), 'R', '') + '.0') = 1 Then
Cast(Replace(Replace(Replace(tblAssets.OScode, '.', ''), 'S', ''),
'R', '') As BIGINT)
Else 0
End As Expr1) As OsCodeNumeric,
Cast(tblAssets.BuildNumber As INT) As BuildNumber
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Outer Join tsysIPLocations On tblAssets.LocationID =
tsysIPLocations.LocationID
Where tsysOS.OSname = 'Win 10' And tblAssetCustom.State = 1 And
tblAssets.BuildNumber Is Not Null) As SQ
Cross Join (Select Max(os1.OSCodeNumeric) As MaxOsCodeNumeric
From tsysOS As os1
Where os1.Sortorder = 18) As mo
Cross Join (Select Max(Cast(a.BuildNumber As INT)) As MaxBuildNumber
From tblAssets As a
Inner Join tsysOS As o On o.OScode = a.OScode
Where o.OSname = 'Win 10' And a.BuildNumber Is Not Null And (Select Case
When IsNumeric(Replace(Replace(Replace(a.OScode, '.', ''), 'S', ''),
'R', '') + '.0') = 1 Then Cast(Replace(Replace(Replace(a.OScode,
'.', ''), 'S', ''), 'R', '') As BIGINT)
Else 0
End As Expr1) = (Select Max(os2.OSCodeNumeric) As Expr1
From tsysOS As os2 Where os2.Sortorder = 18)) As mb
Where (SQ.OsCodeNumeric < mo.MaxOsCodeNumeric) Or
(SQ.BuildNumber < mb.MaxBuildNumber)

1 REPLY 1
Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

The report is failing because somewhere in your database, there is an unexpected format or value. In your case, it seems to be related to the value "19042.1110", as it fails with the error "Conversion failed when converting the nvarchar value '19042.1110' to data type int."

Should you need more help looking at your data, please contact tech support: https://www.lansweeper.com/contact-support/