0 Replies Latest reply on Oct 18, 2010 11:56 AM by rolonv

    Report Writer SQL Question

    rolonv

      Hello all,

      I have this script here that I would like to modify to just show me Mon - Friday between 7am - 7pm.

      SELECT Nodes.Caption AS NodeName,
      StartTime.EventTime,
      StartTime.Message,
      DATEDIFF(Mi, StartTime.EventTime,
          (SELECT TOP 1
              EventTime
              FROM Events AS Endtime
              WHERE EndTime.EventTime > StartTime.EventTime
                  AND EndTime.EventType = 5001
                  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 = 5000)
      AND
      (StartTime.Message LIKE '%Serial0/0/0.50%')
      AND
      StartTime.EventTime between dateadd(week,-5, getdate()) and getdate()