close votes being cast per day versus reviews on close votes

0

Please login or register to vote for this query.

(click on this box to dismiss)

for http://meta.stackexchange.com/questions/191413/can-i-query-close-vote-reviews-on-data

Stack Overflow

Q&A for professional and enthusiast programmers

-- our date range
;with main as (
select distinct 
convert(date,creationdate) as [Date]
from reviewtaskresults
) 
-- our review tasks
, rvc as (
select convert(date,creationdate) as [Date]
      , count(*) as [cnt]
from reviewtaskresults
where ReviewTaskResultTypeId = 6 -- close
group by convert(date,creationdate)
)
-- our closed posts
, pc as (
select convert(date,creationdate) as [Date]
, count(*) as cnt
from posthistory
where posthistorytypeid = 10 -- post closed
group by convert(date,creationdate)
)
-- outer join the whole bups
select main.[date]
    , rvc.cnt as [Close Review Tasks]
    , pc.cnt as [Posts Closed]
from main
left outer  join rvc on rvc.[date] = main.[date]
left outer join pc on pc.[date] = main.[date]
order by main.[date]

Enter Parameters

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