Find answers in date range

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computer Science Educators

Q&A for those involved in the field of teaching Computer Science

declare @userid int = ##userid##
declare @startDate datetime = '##startDate##'
declare @endDate datetime = '##endDate##'

-- select * from users where id=@userid

select 
--t.tagname, count(*)
a.CreationDate,
q.Title,
q.Tags,
case when q.AcceptedAnswerId = a.Id Then 1 else 0 end as AcceptedAnswer,
q.AcceptedAnswerId,
a.Id
from Posts a
inner join Posts q on a.ParentId=q.Id
inner join PostTypes pt on pt.id=a.posttypeid
--inner join PostTags ptags on q.id=ptags.postid
--inner join Tags t on ptags.TagId=t.id
where a.OwnerUserId=@userid
and pt.Name='Answer'
and a.CreationDate > @startDate
and a.CreationDate <= @endDate
--group by t.tagname

Enter Parameters

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