Greeting,
I'm currently working on an automated report for our triggered alerts. The issue I'm running into is formatting the date and time functions. The documentation of these functions doesn't really help a SQL noobie like myself so I'm reaching out here for some insight. Looking at the query you can easily tell what I'm trying to do, which is grab events that happened 24 hours ago. I've not had any luck getting this to work, please halp. Thanks!
SELECT tolocal(EventTime) as [EventTime], C.Nodes.Caption, Message
FROM Orion.Events C
Where hour(EventTime) >= (ADDHOUR()-24,hour) AND EventType = 14 OR EventType = 5000 OR EventType = 5001
Order by EventTime desc