Q&A for developers and researchers interested in open data
-- 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); WITH grouped AS ( SELECT *, (CAST(DATEPART("weekday", CreationDate) AS float) + CAST(DATEPART("hour", CreationDate) AS float) / 24) AS cd FROM Posts ) SELECT cd AS [Day of week + time], COUNT(*) AS [Number of posts] FROM grouped GROUP BY cd ORDER BY cd