declare @startDate date = '##startDate##'; declare @endD...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

-- 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(a.CreationDate as date),
  AvgScore = round(AVG(cast(a.Score as float)),2),
  MinScore = min(a.Score),
  MaxScore = max(a.Score)
--  TotalQues = count(*)
from Posts a
inner join Posts q on q.AcceptedAnswerId = a.Id
where   cast(a.CreationDate as date) between @startDate and @endDate
group by cast(a.CreationDate as date)
order by cast(a.CreationDate as date)

Enter Parameters

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