Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS

Q&A for administrators, end users, developers and designers for Craft CMS

SELECT  count(*) Answers  FROM posts
where posttypeid = 2 and datepart(year,creationdate) = 2015

SELECT  count(*) Question  FROM posts
where posttypeid = 1 and datepart(year,creationdate) = 2015


select resultTable.Years, (cast(count(resultTable.OwnerUserId) as float)/
(SELECT cast(count(*) as float) FROM users 
where datepart(year,creationdate) = 2018))*100 ActiveUserOf2018Yearly
from (
    select datepart(year,creationdate) Years,OwnerUserId, count(*) 
    from Posts where OwnerUserId in 
    (SELECT  Id  FROM users
    where datepart(year,creationdate) = 2018)
    and posttypeid = 2 and datepart(year,creationdate) between 2018 and 2018
    group by datepart(year,creationdate), OwnerUserId 
    having count(*) > 5
) resultTable 
group by resultTable.Years
order by resultTable.Years

SELECT datepart(year,creationdate) Years, count(*) Questions FROM posts
where posttypeid = 1 and datepart(year,creationdate) <= 2018
group by datepart(year,creationdate) 

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results