This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SWQL Covert bytes to GB

Hello All,

I have a SQL query that works great in SQL, but not in SWQL.  I want to convert it to SWQL so I can use it in the Custom Query widget.  Below you find the error I'm receiving in SWQL.  Any help is much appreciated.

SQL - Thumbsup
SELECT n.caption,
       a.deviceid,
       a.volumename,
       cast(a.capacityb / 1073741824.0e AS decimal(10))
FROM   nodes n
JOIN   assetinventory_logicaldrive a
ON     a.nodeid = n.nodeid
WHERE  a.deviceid LIKE 'C:\%'
AND    a.capacityb <= '106300440576'
AND    n.machinetype LIKE 'Windows 2016%'

SWQL - Thumbsdown
SELECT n.caption,a.deviceid,a.volumename,CAST(a.CapacityB / 1073741824.0E AS DECIMAL(10, 2))
FROM Orion.Nodes n
JOIN Orion.AssetInventory.LogicalDrive a ON a.NodeID = n.NodeID
WHERE a.deviceid LIKE 'C:\%'
AND a.capacityb <= '106300440576'
AND n.machinetype LIKE 'Windows 2016%'


ERROR SolarWinds.InformationService.Core.InformationService - SWQL Studio (null)