Q&A for administrators and users of the CiviCRM Constituent Relationship Management software
SELECT 'site://review/close/'+CAST(rt.Id AS varchar)+'|'+CAST(rt.Id AS varchar) AS 'Id', p.Id AS [Post Link], CASE WHEN rt.ReviewTaskStateId = 2 THEN rtrt.Name ELSE 'Invalidated' END AS 'Outcome', CASE WHEN p.ClosedDate IS NOT NULL THEN 'Closed' ELSE 'Open' END FROM ReviewTasks rt LEFT JOIN ReviewTaskResults rtr ON rtr.Id = rt.CompletedByReviewTaskId LEFT JOIN ReviewTaskResultTypes rtrt ON rtr.ReviewTaskResultTypeId = rtrt.Id JOIN Posts p ON rt.PostId = p.Id WHERE 1=1 -- rt.ReviewTaskStateId > 1 --completed or invalidated --AND rt.ReviewTaskTypeId = 2 --close votes and rt.PostId = 229424 --p.Title like '%sandboxing untrusted%' ORDER BY rt.CreationDate DESC