Q&A for designers and implementers of computer programming languages
DECLARE @UserId int = ##UserId##; DECLARE @MinDate datetime = ##MinDate:string##; DECLARE @MaxDate datetime = ##MaxDate:string##; SELECT COUNT(DISTINCT Answers.Id) AS Answers, COUNT(DISTINCT Votes.BountyAmount) AS Votes FROM Posts AS Answers INNER JOIN Posts Questions ON (Answers.ParentId = Questions.Id) INNER JOIN Votes ON (Answers.Id = Votes.PostId) WHERE Answers.OwnerUserId = @UserId AND Answers.CreationDate >= @MinDate AND Answers.CreationDate <= @MaxDate AND Answers.PostTypeId = 2;