We have a report that lists Applications that are in any state other than 'Up' (ie. Warning, Critical, Down); and includes any notes that might be in the "Last XX Notes" field from the Summary page of the affected node. Unfortunately, this creates duplicate listings on the report because it's listing the application/node for each of the notes listed. I need to be able to change this so that it only shows the application/node one time with the most recent note, however, I'm not very proficient with SQL/SWQL. I was hoping someone might be able to suggest how to modify the report's SQL statement to achieve this goal.
Here is the SQL statement being used:
SELECT Name, Status, ISNull(NN.Note, '<none>') AS NodeNotes, DetailsUrl, Application.Node.DisplayName, ToLocal(AStat.LastSuccessfulPoll) AS LastGoodPoll, Application.Node.NodeID, Application.Node.DetailsUrl AS NodeDetailsUrl, Application.Node.Status AS NodeStatus, Application.Node.ChildStatus FROM Orion.APM.Application LEFT JOIN Orion.NodeNotes NN ON NN.NodeID = Application.Node.NodeID LEFT JOIN Orion.APM.CurrentApplicationStatus AStat ON AStat.ApplicationID = Application.ApplicationID WHERE Status <> 1