Q&A for people studying math at any level and professionals in related fields
declare @pStartDate date = '##StartDate##'
declare @pEndDate date = '##EndDate##'
count(*) as QuestionCount,
sum(A.TriedComments) as TriedCount
sum(case when C.text like '%have you tried%' or c.text like '%you have tried%' then 1 else 0 end) as TriedComments,
Posts as P
left join Comments as C on C.PostID = P.ID
P.creationdate between @pStartDate and @pEndDate
and P.posttypeid = 1
) as A