Quantcast
Channel: THWACK: All Content - Network Performance Monitor
Viewing all articles
Browse latest Browse all 21870

Custom SQL Query To Return Average Availability for a Group of Servers

$
0
0

No matter which start date I begin with, the return value is always the same number. I tried one beginning in 2009 until today and it was the same number (100%). I call shenanigans on this custom SQL statement. Any ideas?

 

SET DATEFIRST 6;

SELECT 'Whatever Servers' AS Servers,

AVG(ResponseTime.Availability) AS AVERAGE_of_Availability,

DATEADD(DD, 1-DATEPART(DW, GETDATE()), DATEADD(ww,-1,GETDATE())) AS Start_Date,

DATEADD(DD, 7-DATEPART(DW, GETDATE()), DATEADD(ww,-1,GETDATE())) AS End_Date

 

 

FROM

Nodes INNER JOIN ResponseTime ON (Nodes.NodeID = ResponseTime.NodeID)

 

 

WHERE

( DATEPART(ww,DateTime) = DATEPART(ww, DATEADD(ww,-1,GetDate())) )

AND 

( Nodes.Whatever= 1 )


Viewing all articles
Browse latest Browse all 21870

Trending Articles



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