2020-7-01 2020-9-30

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vegetarianism

Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

DECLARE @StartDate DATE = '2020-1-1';
DECLARE @EndDate DATE = '2020-3-31';

SELECT id 
FROM posts 
WHERE PostTypeId = 1 
AND score > 0 
AND AnswerCount > 0 
AND (
      (
        CreationDate BETWEEN @StartDate AND @EndDate
        AND viewcount > 10000 
        AND LastActivityDate BETWEEN DATEADD(MONTH, -6, GETDATE()) AND GETDATE()
      )
      OR
      (
        CreationDate BETWEEN @StartDate AND @EndDate
        AND viewcount > 15000 
        AND LastActivityDate BETWEEN DATEADD(MONTH, -12, GETDATE()) AND DATEADD(MONTH, -6, GETDATE())
      )
      OR
      (
        CreationDate BETWEEN @StartDate AND @EndDate
        AND viewcount >= 35000 AND viewcount <= 50000 
        AND LastActivityDate < DATEADD(MONTH, -12, GETDATE())
      )
      OR
      (
        CreationDate BETWEEN @StartDate AND @EndDate
        AND viewcount > 50000  
      )
    )

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results