I'm hoping someone can offer me some insight on what I can do here.
I'm using this statement in an Alert email:
${SQL:Select AVG(ResponseTime.Availability) AS AVERAGE_of_Availability FROM Nodes INNER JOIN ResponseTime ON (Nodes.NodeID = ResponseTime.NodeID) WHERE ( DateTime BETWEEN DATEADD(DAY, -2, GETDATE()) AND DATEADD(DAY, -1, GETDATE()) ) AND ((Nodes.NodeID=${NodeID})) }%
If I send the email in plain text mode, it correctly returns the value. If I send it in HTML mode, which I prefer, it gives the following error (32 being the NodeID):
MACRO SQL ERROR - Incorrect syntax near '32'.)) %
If it looks like a parsing bug in Orion, or if there's a way to structure the statement differently to make it work. I have other SQL statements in the same alert email that are working correctly, like this:
${SQL:SELECT convert(varchar, floor(Systemuptime/86400)) + ' days, ' + convert(varchar, (convert(int,Systemuptime)%86400)/3600) + ' hours, ' + convert(varchar, (convert(int,Systemuptime)%3600)/60) + ' minutes ' FROM Nodes WHERE NodeID=${NodeID} }
Any assistance would be greatly appreciated.