I have the following SWQL script. This was working fine until we upgraded our Orion modules, then something broke. It's a union query of two separate, smaller queries. The two queries work indendently of the union. It's like the full query has a problem with the "(" and ")" surounding the second query that is unioned to the first query. Any help would be appreciated.
--Nodes with MUTE turned ON
SELECT
Nodes.Caption AS [Device],
Nodes.DetailsURL AS [_LinkFor_Device],
'/Orion/images/StatusIcons/Small-' + StatusIcon AS [_IconFor_Device],
Nodes.IP_Address AS [IP],
Nodes.DetailsURL AS [_LinkFor_IP],
DATETRUNC('MINUTE', Alerts.SuppressFrom) AS [Mute from],
DATETRUNC('MINUTE', Alerts.SuppressUntil) AS [Mute Until],
NULL AS [Custom m_Mute],
Nodes.CustomProperties.Comments
FROM Orion.AlertSuppression AlertS
JOIN Orion.nodes ON Nodes.uri = AlertS.EntityURI
UNION
(SELECT
Nodes.caption AS [Device],
Nodes.DetailsURL AS [_LinkFor_Device],
'/Orion/images/StatusIcons/Small-' + StatusIcon AS [_IconFor_Device],
Nodes.IP_Address AS [IP],
Nodes.DetailsURL AS [_LinkFor_IP],
NULL AS [Mute from],
NULL AS [Mute Until],
Nodes.CustomProperties.m_Mute AS [Custom m_Mute],
Nodes.CustomProperties.Comments
FROM Orion.Nodes
WHERE
Nodes.Status != '2'
AND Nodes.CustomProperties.m_Mute = 'TRUE')