User's posts by Year-Month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sports

Q&A for participants in team and individual sport activities

select count(*), PostTypes.Name + ' posts'
from Posts
join PostTypes on (PostTypes.Id = Posts.PostTypeId)
where OwnerUserId = ##UserId##
and CreationDate between cast(##StartDate:string## as datetime) and cast(##EndDate:string## as datetime)
group by PostTypes.Name + ' posts'
union all
select count(*), VoteTypes.Name + ' votes'
from Votes
join Posts on (Posts.Id = Votes.PostId)
join VoteTypes on (VoteTypes.Id = Votes.VoteTypeId)
where Posts.OwnerUserId = ##UserId##
and Posts.CreationDate between cast(##StartDate:string## as datetime) and cast(##EndDate:string## as datetime)
group by VoteTypes.Name + ' votes'
union all
select count(*), 'comments' from Comments
where UserId = ##UserId##
and CreationDate between cast(##StartDate:string## as datetime) and cast(##EndDate:string## as datetime)
union all
select sum(Score), 'total comment votes' from Comments
where UserId = ##UserId##
and CreationDate between cast(##StartDate:string## as datetime) and cast(##EndDate:string## as datetime)

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results