Q&A for programming puzzle enthusiasts and code golfers
DECLARE @PostId int = ##PostId## SELECT COUNT(*) from ( select * from Votes v where v.PostId = @PostId and v.VoteTypeId = 2 and v.CreationDate < CAST('2016-11-17' AS DATE) ) src;