Testing

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

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

select resulttable.Years Years, count(resulttable.OwnerUserId) ActiveusersByQuesYearly,
(count(resulttable.OwnerUserId)/(select cast(count(*) as float) from users where year(creationdate) <= resulttable.Years))*100 as percentage,
		cast(round((count(resulttable.OwnerUserId)/(select cast(count(*) as float) from users where year(creationdate) <= resulttable.Years)*100 ),2) as NUMERIC(15,2)) percentageRound,
		cast(count(resulttable.OwnerUserId) as varchar(20))+ CHAR(13) + CHAR(10) +'(' 
        +cast( cast(round((count(resulttable.OwnerUserId)/(select cast(count(*) as float) from users where year(creationdate) <= resulttable.Years)*100 ),2) as NUMERIC(15,2))   as varchar(20))+
		'%)' StringPercentatge  
from (
select datepart(year,posts.creationdate) Years, OwnerUserId,  count(*) AskedQuestion5  
        from posts where OwnerUserId is not null 
		and datepart(year,posts.creationdate) <= 2018
		group by datepart(year,posts.creationdate), posts.OwnerUserId
		having count(posts.OwnerUserId) > 4
		) resulttable 
		group by resulttable.Years
        order by resulttable.Years

Enter Parameters

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