SELECT Id AS [Post Link], (SELECT MAX(v) FROM (VALUES (Cl...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Genealogy and Family History Meta

Q&A about the site for expert genealogists and people interested in genealogy or family history

SELECT Id AS [Post Link], (SELECT MAX(v) FROM (VALUES (ClosedDate), (LastEditDate)) AS value(v)) AS MaxDate
	FROM Posts
	WHERE CONVERT(date,ClosedDate) <= DATEADD(d, -5, CONVERT(date,GETUTCDATE()))
	AND (CONVERT(date,LastEditDate) <= DATEADD(d, -5, CONVERT(date,GETUTCDATE()))
	         OR LastEditDate IS NULL)
	  AND CreationDate >= DATEADD(d, -30, CONVERT(date,GETUTCDATE()))
	  AND Score <= 1
	  AND AcceptedAnswerId IS NULL
	  -- Exclude positive answers
	  AND NOT EXISTS (SELECT * FROM Posts p2 WHERE p2.ParentId = Posts.Id AND Score > 0)
	  -- Exclude closed as duplicate
	  AND NOT EXISTS (SELECT * FROM PostLinks WHERE PostId = Posts.Id AND LinkTypeId = 3)
	  -- Exclude migrated and merged
	  AND NOT EXISTS (SELECT * FROM PostHistory WHERE PostId = Posts.Id AND PostHistoryTypeId IN (17,18,35,37))
ORDER BY 2

Enter Parameters

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