Anton.Sandbox

1

Please login or register to vote for this query.

(click on this box to dismiss)

Personal Finance and Money

Q&A for people who want to be financially literate

-- At what hour do I ask most posts, both questions and answers?
-- UTC (GMT) time zone. The week starts with Sunday.
-- Parameters:
--   UserId
--   HourOrDOW (1 - hours, 2 - day of week)

-- DEFINE @var = DATEPART("weekday", CreationDate), DATENAME("hour", CreationDate);

SELECT
    
    DATENAME("hour", CreationDate),
    DATEPART("weekday", CreationDate) AS [Weekday you add a post],
    COUNT(*) AS [Number of posts answered]
  FROM Posts
  GROUP BY DATENAME("hour", CreationDate), DATEPART("weekday", CreationDate)
  ORDER BY DATENAME("hour", CreationDate), DATEPART("weekday", CreationDate)

Enter Parameters

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