Proportion of answers that are accepted

0

Please login or register to vote for this query.

(click on this box to dismiss)

SharePoint

Q&A for SharePoint enthusiasts

SELECT COUNT(a.Id) AS TotalAnswers,
       COUNT(CASE WHEN a.AcceptedAnswerId = a.Id THEN 1 END) AS AcceptedAnswers,
       (CAST(COUNT(CASE WHEN a.AcceptedAnswerId = a.Id THEN 1 END) AS FLOAT) / COUNT(a.Id)) * 100 AS AcceptanceRate
FROM Posts a
WHERE a.OwnerUserId = ##UserId##
AND a.PostTypeId = 2;

Enter Parameters

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