Necromancer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Find all of a users answers with a score of 5 or more and computer the lag between the question asked date and the users answered date

English Language Learners

Q&A for speakers of other languages learning English

-- Necromancer
-- Find all of a users answers with a score of 5 or more and computer the lag between the question asked date and the users answered date

DECLARE @UserId int = ##UserId##

SELECT
  --q.Id,
  q.Title,
  q.CreationDate AS AskedDate,
  --a.Id,
  a.CreationDate AS AnsweredDate,
  DATEDIFF(day, q.CreationDate, a.CreationDate) AS DaysBetween
FROM
  Posts AS q JOIN Posts AS a ON a.ParentId = q.Id
WHERE
    a.OwnerUserId = @UserId
    AND a.PostTypeId = 2
    AND a.Score >= 5
;

Enter Parameters

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