SELECT CONVERT(float, SUM((UpVotes + DownVotes) / DATEDIF...

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 CONVERT(float,
  SUM((UpVotes + DownVotes) / DATEDIFF(day, CreationDate, LastAccessDate)))
  / CONVERT(float, COUNT(*))
AS VotesPerDay
FROM Users
WHERE DATEDIFF(day, CreationDate, LastAccessDate) <> 0
  AND LastAccessDate > CONVERT(DateTime, '2015-12-27')
ORDER BY VotesPerDay DESC;
--LastAccessDate > CONVERT(DateTime, '2016-08-01')

Enter Parameters

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