Average score of questions by creation date

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

-- Average score of questions by creation date
-- only for unclosed and not community owned questions

declare @startDate date = '##startDate##';
declare @endDate date = '##endDate##';

select
  cast( CreationDate as date),
  AvgScore = round(AVG( cast( Score as float ) ),2)
--  TotalQues = count(*)
from
  Posts
where
  PostTypeId = 1 and
  cast( CreationDate as date) between @startDate and @endDate and ClosedDate is null and CommunityOwnedDate is null
group by cast ( CreationDate as date )
order by cast ( CreationDate as date )

Enter Parameters

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