Number of first questions which get closed (per day, between dates)

1

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

;with firstpostids_cte as (
SELECT MIN(Id) AS MinId, OwnerUserId, OwnerDisplayName
FROM Posts
WHERE PostTypeId=1
GROUP BY OwnerUserId, OwnerDisplayName
)
, firstpostsclosed_cte as (
SELECT
p.Id, p.CreationDate AS cre, p.ClosedDate AS clo
FROM firstpostids_cte fp JOIN Posts p ON fp.MinId=p.Id
)

SELECT 
CAST(cre AS date), COUNT(clo) AS closed, COUNT(*) AS total, ROUND((COUNT(clo))*100.0/(COUNT(*)),2) AS percentage
FROM firstpostsclosed_cte
WHERE cre >= '##Date1##' AND cre <= '##Date2##'
GROUP BY CAST(cre AS date)
ORDER BY CAST(cre AS date)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results