My Activity by UTC Hour

0

Please login or register to vote for this query.

(click on this box to dismiss)

What time of day do I post questions and answers most?

Open Source Meta

Q&A about the site for people organizing, marketing or licensing open source development projects

-- My Activity by UTC Hour
-- What time of day do I post questions and answers most?

DECLARE @Questions int, @Answers int;

SELECT @Questions = COUNT(*)
FROM posts
WHERE posttypeid = 1
AND OwnerUserId = ##UserID##

SELECT @Answers = COUNT(*)
FROM posts
WHERE posttypeid = 2
AND OwnerUserId = ##UserID##

SELECT
 datepart(hour,creationdate) AS hour,
 100 * count(CASE WHEN posttypeid = 1 THEN 1 END) / (1.0 * @Questions) AS questions,
 100 * count(CASE WHEN posttypeid = 2 THEN 1 END) / (1.0 * @Answers) AS answers
FROM posts
WHERE
  posttypeid IN (1,2) AND
  OwnerUserId=##UserID##
GROUP BY datepart(hour,creationdate)
ORDER BY hour

Enter Parameters

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