select dateadd(week, datediff(week, 0, creationdate), 0),...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Engineering

Q&A for expert programmers interested in professional discussions on software development

select dateadd(week, datediff(week, 0, creationdate), 0), 
votetypes.Name, count(*)
from votes
inner join votetypes on votes.votetypeid = votetypes.id
where votes.creationdate >= '1/1/2011' and votes.votetypeid in (2, 3, 10, 11, 6)

group by dateadd(week, datediff(week, 0, votes.creationdate), 0), votetypes.name, votetypes.id
order by dateadd(week, datediff(week, 0, votes.creationdate), 0), votetypes.id

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results