Mod votes by date

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

SELECT
  b.Name,
  DATEPART(YEAR, b.Date) AS ElectionYear,
  CAST(b.Date AS DATE) AS VoteDate,
  DATEPART(HOUR, b.Date) AS VoteHour,
  COUNT(*) AS BadgeCount
FROM Badges b
WHERE Name = 'Constituent'
GROUP BY
  DATEPART(YEAR, b.Date),
  CAST(b.Date AS DATE),
  DATEPART(HOUR, b.Date),
  b.Name
ORDER BY
  COALESCE(DATEPART(YEAR, b.Date), 2525),
  COALESCE(CAST(b.Date AS DATE), GetDate()),
  DATEPART(HOUR, b.Date)

Enter Parameters

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