Ok all you SQL jocks, I need some help. The SQL syntax below was pulled from this site and works well to pull all events for a period. I need a derivative of it that pulls all events with the word Sprint in the message. Here is the generic syntax
SELECT
StartTime.EventTime,
Nodes.Caption,
Nodes.Location,
StartTime.Message,
DATEDIFF(Mi, StartTime.EventTime,
(SELECT TOP 1
EventTime
FROM Events AS Endtime
WHERE EndTime.EventTime > StartTime.EventTime AND EndTime.EventType = 5
AND EndTime.NetObjectType = 'N'
AND EndTime.NetworkNode = StartTime.NetworkNode
ORDER BY EndTime.EventTime)) AS OutageDurationInMinutes
FROM Events StartTime INNER JOIN Nodes ON StartTime.NetworkNode = Nodes.NodeID
WHERE (StartTime.EventType = 1) AND (StartTime.NetObjectType = 'N') AND
eventtime between dateadd(month, -1, getdate()) and getdate()
ORDER BY Nodes.Caption ASC
I've tried putting in in the Where statments Startime.message LIKE '%Sprint%' and several derivatives and all it does is pull up every thing and negates the duration calcs. Any ideas