Attempts to find days you got 20+ upvotes
Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language
-- Days you might have reputation capped -- Attempts to find days you got 20+ upvotes DECLARE @UserId int = ##UserId## SELECT CAST(Votes.CreationDate as DATE), SUM(CASE WHEN Votes.VoteTypeId = 2 THEN 10 WHEN Votes.VoteTypeId = 3 THEN -2 ELSE 0 END) as VoteRep FROM Posts JOIN Votes ON Posts.id = Votes.PostId WHERE Posts.OwnerUserId = @UserID AND Votes.VoteTypeId = 2 GROUP BY CAST(Votes.CreationDate as DATE) HAVING SUM(CASE WHEN Votes.VoteTypeId = 2 THEN 10 WHEN Votes.VoteTypeId = 3 THEN -2 ELSE 0 END) > 200 ORDER BY CAST(Votes.CreationDate as DATE)