Testing

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla

Q&A for Joomla! administrators, users, developers and designers

select a.Years, sum(a.ReviewNumber) RevionNumber,
(sum(a.ReviewNumber)/cast(15028541 as float))*100 as percentage,
cast(round((sum(a.ReviewNumber)/cast(15028541 as float)*100 ),2) as NUMERIC(15,2)) percentageRound,
cast(sum(a.ReviewNumber) as varchar(20))+ CHAR(13) + CHAR(10) +'(' 
+cast( cast(round((sum(a.ReviewNumber)/cast(15028541 as float)*100 ),2) as NUMERIC(15,2))   as varchar(20))+
'%)' StringPercentatge from(
select datepart(year,ps.creationdate) Years, 
count(*) ReviewNumber from posthistory ps
inner join posts a
on ps.postid = a.id and a.posttypeid = 2
inner join posts q
on a.parentid = q.id and q.acceptedAnswerId is not null
where datepart(year,ps.creationdate) <=2018
group by datepart(year,ps.creationdate)
) a 
group by a.Years
/*
union 
select datepart(year,ps.creationdate) Years, 
count(*) ReviewNumber from posthistory ps
inner join posts a
on ps.postid = a.id and a.posttypeid = 2
inner join posts q
on a.parentid = q.id and q.acceptedAnswerId is not null
where datepart(year,ps.creationdate) <=2018
group by datepart(year,ps.creationdate)*/

Enter Parameters

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