Total Votes over time

1

Please login or register to vote for this query.

(click on this box to dismiss)

Unix and Linux

Q&A for users of Linux, FreeBSD and other Un*x-like operating systems

select dateadd(week, datediff(week, 0, v.CreationDate), 0) wk, count(*)
from votes v
where 
 v.CreationDate < dateadd(week, datediff(week, 0, getdate()), 0)-1
 and (v.votetypeid = 2 or v.votetypeid = 3)
group by dateadd(week, datediff(week, 0, v.CreationDate), 0)
order by dateadd(week, datediff(week, 0, v.CreationDate), 0)

Enter Parameters

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