‎05-04-2015 11:59 AM
Select Top 1000000 tblAssets_1.AssetID,
tblAssets_1.AssetName,
tblAssets_1.Domain,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblBIOS.SMBIOSBIOSVersion As CurrentBios,
Bios.biosMax As LatestBios,
Case When tblBIOS.SMBIOSBIOSVersion = Bios.biosMax Then 'black' Else 'red'
End As foregroundcolor,
tsysOS.Image As icon
From tblAssets As tblAssets_1
Inner Join tblBIOS On tblAssets_1.AssetID = tblBIOS.AssetID
Inner Join tblAssetCustom On tblAssets_1.AssetID = tblAssetCustom.AssetID
Inner Join (Select tblAssetCustom_1.Manufacturer,
tblAssetCustom_1.Model,
Max(tblBIOS_1.SMBIOSBIOSVersion) As biosMax
From tblAssets
Inner Join tblAssetCustom As tblAssetCustom_1 On tblAssets.AssetID =
tblAssetCustom_1.AssetID
Inner Join tblBIOS As tblBIOS_1 On tblAssets.AssetID = tblBIOS_1.AssetID
Where tblAssetCustom_1.Model Not Like 'VirtualBox' And
tblAssetCustom_1.Model Not Like 'VMware Virtual Platform' And
tblAssetCustom_1.Model Not Like 'Virtual Machine'
Group By tblAssetCustom_1.Manufacturer,
tblAssetCustom_1.Model) As Bios On tblAssetCustom.Model = Bios.Model And
tblAssetCustom.Manufacturer = Bios.Manufacturer And
tblBIOS.SMBIOSBIOSVersion <> Bios.biosMax
Inner Join tsysOS On tsysOS.OScode = tblAssets_1.OScode
Where tblBIOS.SMBIOSBIOSVersion <> Bios.biosMax And tblAssetCustom.State = 1
Order By tblAssets_1.AssetName
‎05-14-2019 05:21 PM
Rick I wrote:
Tom D,
Not sure what this means but when I implement your code vs the original I get the following
"There was an error parsing the query. [ Token line number = 1,Token line offset = 613,Token in error = With ]"
‎05-14-2019 09:04 PM
Tom D wrote:
What version are you running I am running Version 7 (Latest), I am unsure as to what version this requires. I wrote all the code in just SQL Server studio, then ported it to the WebUI. What version are you on?Rick I wrote:
Tom D,
Not sure what this means but when I implement your code vs the original I get the following
"There was an error parsing the query. [ Token line number = 1,Token line offset = 613,Token in error = With ]"
‎05-14-2019 09:29 PM
Rick I wrote:
Lansweeper v. 7.1.100.16Tom D wrote:
What version are you running I am running Version 7 (Latest), I am unsure as to what version this requires. I wrote all the code in just SQL Server studio, then ported it to the WebUI. What version are you on?Rick I wrote:
Tom D,
Not sure what this means but when I implement your code vs the original I get the following
"There was an error parsing the query. [ Token line number = 1,Token line offset = 613,Token in error = With ]"
‎05-11-2019 04:10 PM
Select Top 1000000 tblAssets_1.AssetID,
tblAssets_1.AssetName,
tblAssets_1.Domain,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblBIOS.SMBIOSBIOSVersion As CurrentBios,
Bios.biosMaxVersion as NewerBiosVersion,
Bios.biosMax as NewerBiosVersionReleaseDate,
Case When tblBIOS.SMBIOSBIOSVersion = Bios.biosMaxVersion Then 'black' Else 'red'
End As foregroundcolor,
tsysOS.Image As icon
From tblAssets As tblAssets_1
Inner Join tblBIOS On tblAssets_1.AssetID = tblBIOS.AssetID
Inner Join tblAssetCustom On tblAssets_1.AssetID = tblAssetCustom.AssetID
Inner Join (Select TOP 1 WITH TIES tblAssetCustom_1.Manufacturer,
tblAssetCustom_1.Model,
tblBIOS_1.SMBIOSBIOSVersion as biosMaxVersion,
Max(tblBIOS_1.ReleaseDate) As biosMax
From tblAssets
Inner Join tblAssetCustom As tblAssetCustom_1 On tblAssets.AssetID =
tblAssetCustom_1.AssetID
Inner Join tblBIOS As tblBIOS_1 On tblAssets.AssetID = tblBIOS_1.AssetID
Where tblAssetCustom_1.Model Not Like 'VirtualBox' And
tblAssetCustom_1.Model Not Like 'VMware Virtual Platform' And
tblAssetCustom_1.Model Not Like 'Virtual Machine' and
tblAssetCustom_1.Model Not Like '' and
tblAssetCustom_1.Manufacturer not like 'VMware%' and
tblAssetCustom_1.Manufacturer not like 'Amazon%'
Group By tblAssetCustom_1.Manufacturer,
tblAssetCustom_1.Model, tblBIOS_1.SMBIOSBIOSVersion, tblBIOS_1.ReleaseDate
ORDER BY
ROW_NUMBER() OVER(PARTITION BY Model ORDER BY Model, tblBIOS_1.ReleaseDate DESC)) As Bios On tblAssetCustom.Model = Bios.Model And
tblAssetCustom.Manufacturer = Bios.Manufacturer and
tblBIOS.SMBIOSBIOSVersion <> Bios.biosMaxVersion
Inner Join tsysOS On tsysOS.OScode = tblAssets_1.OScode
Where tblBIOS.SMBIOSBIOSVersion <> Bios.biosMaxVersion And tblAssetCustom.State = 1
Order By tblAssets_1.AssetName
Select Top 1000000 tblAssets_1.AssetID,
tblAssets_1.AssetName,
tblAssets_1.Domain,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblBIOS.SMBIOSBIOSVersion As CurrentBios,
Bios.biosMaxVersion as NewerBiosVersion,
Bios.biosMax as NewerBiosVersionReleaseDate,
Case When tblBIOS.SMBIOSBIOSVersion = Bios.biosMaxVersion Then 'black' Else 'red'
End As foregroundcolor,
tsysOS.Image As icon
From tblAssets As tblAssets_1
Inner Join tblBIOS On tblAssets_1.AssetID = tblBIOS.AssetID
Inner Join tblAssetCustom On tblAssets_1.AssetID = tblAssetCustom.AssetID
Inner Join (Select TOP 1 WITH TIES tblAssetCustom_1.Manufacturer,
tblAssetCustom_1.Model,
tblBIOS_1.SMBIOSBIOSVersion as biosMaxVersion,
Max(tblBIOS_1.ReleaseDate) As biosMax
From tblAssets
Inner Join tblAssetCustom As tblAssetCustom_1 On tblAssets.AssetID =
tblAssetCustom_1.AssetID
Inner Join tblBIOS As tblBIOS_1 On tblAssets.AssetID = tblBIOS_1.AssetID
Where tblAssetCustom_1.Model Not Like 'VirtualBox' And
tblAssetCustom_1.Model Not Like 'VMware Virtual Platform' And
tblAssetCustom_1.Model Not Like 'Virtual Machine' and
tblAssetCustom_1.Model Not Like '' and
tblAssetCustom_1.Manufacturer not like 'VMware%' and
tblAssetCustom_1.Manufacturer not like 'Amazon%'
Group By tblAssetCustom_1.Manufacturer,
tblAssetCustom_1.Model, tblBIOS_1.SMBIOSBIOSVersion, tblBIOS_1.ReleaseDate
ORDER BY
ROW_NUMBER() OVER(PARTITION BY Model ORDER BY Model, tblBIOS_1.ReleaseDate DESC)) As Bios On tblAssetCustom.Model = Bios.Model And
tblAssetCustom.Manufacturer = Bios.Manufacturer
Inner Join tsysOS On tsysOS.OScode = tblAssets_1.OScode
Where tblAssetCustom.State = 1
Order By tblAssets_1.AssetName
‎04-15-2019 10:36 PM
‎02-22-2019 06:08 PM
‎11-21-2018 01:01 PM
‎09-06-2018 03:45 PM
‎05-10-2018 05:31 PM
‎04-30-2018 06:04 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now