Average Time to Close a Question.

0

Please login or register to vote for this query.

(click on this box to dismiss)

Tridion

Q&A for Tridion developers and administrators

select datepart(year, creationdate) as Year
     , datepart(q, creationdate) as Quarter
     , count(*) as [Total]
     , count(case when closeddate is not null 
                      then 1 else null end 
             ) as [Closed]
     , avg(case when datediff(d, creationdate, closeddate) <= 7 and closeddate is not null
     then datediff(s, creationdate, closeddate)
               end
               ) as [ACT - 7 days]
     , avg(case when datediff(d, creationdate, closeddate) <= 1 and closeddate is not null
     then datediff(s, creationdate, closeddate)
               end
               ) as [ACT - 1 day]
     , cast( 100.0 
             / cast(count(*) as float)
             * cast(count(case when closeddate is not null 
                                   then 1 else null end) as float)
            as numeric(3,2) ) as [% Closed]
  from posts
 where posttypeid = 1
 group by datepart(year, creationdate)
        , datepart(q, creationdate)
 order by datepart(year, creationdate)
        , datepart(q, creationdate)

Enter Parameters

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