Anton.Sandbox

1

Please login or register to vote for this query.

(click on this box to dismiss)

Portuguese Language

Q&A for linguists, teachers and learners wanting to discuss the finer points of the Portuguese language

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

IF ##HourOrDOW:int?1## = 1
  SELECT
    DATEPART("hour", CreationDate) AS [Hour you add a post],
    COUNT(*) AS [Number of your posts per hour]
  FROM Posts
  WHERE OwnerUserId = ##UserId##
  GROUP BY DATEPART("hour", CreationDate)
ELSE
SELECT
    DATEPART("weekday", CreationDate) AS [Weekday you add a post],
    COUNT(*) AS [Number of your posts per weekday]
  FROM Posts
  WHERE OwnerUserId = ##UserId##
  GROUP BY DATEPART("weekday", CreationDate)

Enter Parameters

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