SELECT (SELECT COUNT(*) FROM Posts WHERE DATEPART(dw, Cre...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Robotics Meta

Q&A about the site for professional robotic engineers, hobbyists, researchers and students

SELECT
(SELECT COUNT(*)
 FROM Posts
 WHERE DATEPART(dw, CreationDate) = 1 AND PostTypeId = 2
 ) AS sundayPosts,
 (SELECT COUNT(*)
  FROM Posts
  WHERE DATEPART(dw, CreationDate) = 2 AND PostTypeId = 2
  ) AS mondayPosts,
  (SELECT COUNT(*)
    FROM Posts
    WHERE DATEPART(dw, CreationDate) = 3 AND PostTypeId = 2
    ) AS tuesdayPosts,
    (SELECT COUNT(*)
    FROM Posts
    WHERE DATEPART(dw, CreationDate) = 4 AND PostTypeId = 2
    )AS wednesdayPosts,
    (SELECT COUNT(*)
     FROM Posts
     WHERE DATEPART(dw, CreationDate) = 5 AND PostTypeId = 2
     ) AS thursdayPosts,
     (SELECT COUNT(*)
      FROM Posts
      WHERE DATEPART(dw, CreationDate) = 6 AND PostTypeId = 2
      ) AS fridayPosts,
      (SELECT COUNT(*)
    FROM Posts
    WHERE DATEPART(dw, CreationDate) = 7 AND PostTypeId = 2
    ) AS saturdayPosts

Enter Parameters

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