TODO: add a requirement that the Q-asker has logged in in the past .... year " If any of the answers solved your problem, please [accept it](https://unix.stackexchange.com/help/someone-answers) by clicking the checkmark next to it. Thank you! "
Q&A for professional and enthusiast programmers
SELECT q.Id as [Post Link], q.CreationDate, a.Score, q.AnswerCount, (DATEDIFF(WEEK, u.LastAccessdate, GETDATE())) as WeeksSinceUserLastLogin FROM Posts q -- the Answer is tied to the listed Question INNER JOIN Posts a ON a.ParentId = q.Id JOIN Users u ON u.Id = q.OwnerUserId WHERE -- 1 = Question q.PostTypeId = 1 -- Q does not have an accepted Answer AND q.AcceptedANswerId IS NULL -- Q is not closed AND q.ClosedDate IS NULL -- I wrote an Answer AND a.OwnerUserId = ##UserId:Int?117549## -- the asker has logged in "recently" AND (DATEDIFF(WEEK, u.LastAccessdate, GETDATE())) < 52 ORDER BY a.CreationDate DESC