Best time to ask question

2

Please login or register to vote for this query.

(click on this box to dismiss)

Best time when you can get the most valuable answer

Code Golf and Coding Challenges Meta

Q&A about the site for programming puzzle enthusiasts and code golfers

-- get post time of accepted answers, 
SELECT QuestionTime, COUNT(*) AS num FROM (

SELECT 
  CAST(CAST(CAST(Posts.CreationDate AS time) AS varchar(2)) AS int)[AnswerTime]
  ,CAST(CAST(CAST(AcceptedAnswers.QuestionDate AS time) AS varchar(2)) AS int)[QuestionTime]
  --,Posts.CreationDate AS AnswerDateTime
  --,AcceptedAnswers.QuestionDate AS QuestionDateTime
FROM 
  Posts, 
  (
  SELECT 
    AcceptedAnswerId
    , Id AS QuestionId
    , CreationDate AS QuestionDate --creation date of question
    --, Users.Reputation
  FROM 
    Posts 
    --INNER JOIN Users ON Posts.OwnerUserId = Users.Id
  WHERE  
    AcceptedAnswerId >= 1      
    
    --good answers
    ----AND Score > 50      
    --since removal of accept rate from stackexchange
    ----AND CreationDate > Convert(datetime, '1 FEB 2013' )      
    --from expert users (it doesn't make much difference)
    ----AND Users.Reputation >10000
  ) AS AcceptedAnswers
WHERE
  Posts.Id = AcceptedAnswers.AcceptedAnswerId --answers posts
  AND DATEDIFF(hour,AcceptedAnswers.QuestionDate,Posts.CreationDate) < 1
) AS TimesTable
GROUP BY
  QuestionTime
  --,AnswerTime  
ORDER BY
  --AnswerTime ASC
  QuestionTime ASC

Enter Parameters

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