I am trying to write a SWQL query that will eventually be used in an API call. This was oringally a SQL query that worked perfectly but some of it doesn't seem to work properly in SWQL. The SWQL is as follows:
SELECT N.Caption AS NodeName, N.StatusDescription, NCP.City, N.CPULoad AS CPUPercentUtilization, N.PercentMemoryUsed AS PercentMemoryUsed, NCP.Primary_Function AS PrimaryFunction, AVG(Availability) AS Availability
FROM Orion.Nodes N
JOIN Orion.NodesCustomProperties NCP ON N.NodeID = NCP.NodeID
JOIN Orion.ResponseTime RT ON N.NodeID = RT.NodeID
WHERE NCP.CustomerID = '16710' AND RT.DateTime >= DATEADD(DAY, -30, GETDATE())
Group By N.Caption, N.Vendor, N.StatusDescription, NCP.City, N.CPULoad, N.PercentMemoryUsed, NCP.Primary_Function
Order By NodeName Asc
The error that I am receiving is "Cannot resolve propery DAY" leading me to believe the bit that it's having problems with is the following:
RT.DateTime >= DATEADD(DAY, -30, GETDATE())
I am trying to get the Availability data for the last 30 days, any help with this would be greatly appreciated; thanks!