Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20958

SQL Question

$
0
0

I'm trying to edit the existing 95th percentile report to only include certain interfaces that all contain specific text in the caption.  I have little experience with SQL and have been trying to find the right answer with Google but have been unsuccessful, hoping someone can help.

 

Here is the existing report SQL:

 

SET NOCOUNT OFF

SET ROWCOUNT 0

 

 

DECLARE @StartDate DateTime

DECLARE @EndDate DateTime

 

 

SET @StartDate = DATEADD(d, DATEDIFF(d, 0, DATEADD(m, -1, DATEADD(d, 1 - day(getdate()), getdate()))), 0)

SET @EndDate = DATEADD(ms, -2,DATEADD(d, DATEDIFF(d, 0, DATEADD(d, 1 - day(getdate()), getdate())), 0))

 

 

SELECT Interfaces.InterfaceId,

  Nodes.NodeID,

  Nodes.Caption AS NodeName,

  Nodes.VendorIcon AS Vendor_Icon,

  Interfaces.Caption AS Interface_Caption,

  Interfaces.InterfaceIcon AS Interface_Icon,

  Maxbps_In95,

  Maxbps_Out95,

  Maxbps_95

FROM Nodes

INNER JOIN Interfaces ON Nodes.NodeID = Interfaces.NodeID

INNER JOIN (

  SELECT InterfaceID,

  dbo.GetInBps95th(InterfaceID, @StartDate, @EndDate) AS Maxbps_In95,

  dbo.GetOutBps95th(InterfaceID, @StartDate, @EndDate) AS Maxbps_Out95,

  dbo.GetMaxBps95th(InterfaceID, @StartDate, @EndDate) AS Maxbps_95

  FROM InterfaceTraffic

  WHERE InterfaceTraffic.DateTime >= @StartDate AND InterfaceTraffic.DateTime <= @EndDate      

  GROUP BY InterfaceID

) TrafficStat

ON Interfaces.InterfaceID = TrafficStat.InterfaceID

ORDER BY NodeName, Interface_Caption

 

I need to filter the results to only show interfaces with text that contains D49,  is that possible?

 

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 20958

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>