Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games
SELECT Answers.Id AS [Post Link] , Questions.Id AS [Post Link] , Answers.CreationDate AS AnswerDate , PostHistory.CreationDate AS EditDate , DATEDIFF(hh, PostHistory.CreationDate, Answers.CreationDate) AS TimeDifference FROM Posts AS Answers JOIN Posts AS Questions ON Answers.ParentId = Questions.Id JOIN PostHistory ON PostHistory.PostId = Questions.Id JOIN PostHistoryTypes ON PostHistory.PostHistoryTypeId = PostHistoryTypes.Id WHERE Answers.OwnerUserId = ##UserId## AND Questions.OwnerUserId <> ##UserId## AND Answers.PostTypeId = 2 AND PostHistory.UserId = ##UserId## AND PostHistory.CreationDate BETWEEN DATEADD(hh, -12, Answers.CreationDate) AND DATEADD(hh, 12, Answers.CreationDate);