Top users (rep) in the past n days - incomplete attempt

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

DECLARE @days_diff int = ##DaysBack:int?7##
DECLARE @num_users int = ##HowManyUsers:int?10##

SELECT TOP (@num_users)
  u.Id AS [User Link],
  u.Reputation
FROM
  Users as u,
  Votes as v
WHERE
  v.CreationDate >= DATEADD(DAY, -@days_diff, GETDATE())
  AND v.UserId = u.Id
ORDER BY
  u.Reputation DESC

Enter Parameters

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