The top 200 questions with the most views
Q&A for those who create, solve, and study puzzles
-- Questions with most views -- The top 20 questions with the most views DECLARE @To_Date datetime = dateadd(mm,3, ##StartDate##) DECLARE @From_Date datetime = ##StartDate## Print 'from ' + format(@From_Date, 'D') + ' to ' + format(@To_Date, 'D') SELECT TOP 20 Posts.Id AS [Post Link], OwnerDisplayName, ViewCount, AnswerCount, FavoriteCount, Score FROM Posts LEFT JOIN PostTags ON PostTags.PostId = Posts.ParentId LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE ClosedDate is null and CreationDate between @From_Date and @To_Date ORDER BY ViewCount DESC