Review Time StdDev by Weekday and Queue

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT DATEPART(dayofyear, DeletionDate) AS DoY,
DATEPART(weekday, DeletionDate) AS Weekday,
  Round(DATEDIFF(second, CreationDate, DeletionDate) / 3600.0, 4) AS Duration
INTO #ReviewTimes
FROM ReviewTasks
WHERE ReviewTaskTypeId = ##ReviewTaskType:int?2##
   AND DeletionDate > DATETIMEFROMPARTS(##year:int?2018##, ##month:int?1##, ##day:int?1##, 0, 0, 0, 0);
   
SELECT DoY
  ,Weekday
  ,Round(STDEV(Duration), 4) AS [StDev]
  --,Round(VAR(Duration), 4) AS [Variance] 
  ,Round(AVG(Duration), 4) AS [Average]
  ,Count(Duration) AS TotalTasks
FROM #ReviewTimes
GROUP BY DoY, Weekday
Having Count(Duration) > 1
ORDER BY DoY ASC;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results