3

The closest match upon searching was How do I find out the total number of accepted answers?

However my query is slightly different. I also tried searching existing queries but couldn't find what I am looking for.

I would like to know the number of questions I have answered month wise since 1st May 2013 till 28th Feb 2014. I am not looking for Accepted or Upvoted answers. Just a summary of all the answers. For example

May 2013    10
June 2013   13
July 2013   14
'
'
' And so on

It's that time of the year when I have to submit this info to my MVP lead and I really do not want to backtrack and manually calculate the info that I need.

Any suggestion on how should I proceed?

4
  • Do you intend to do this with the Data Explorer? If so, do you know SQL/have you made an attempt at an appropriate SQL query?
    – user206222
    Commented Mar 28, 2014 at 4:28
  • @Emracool: I have seen different queries such as THIS And I tried editing couple of them and trying them but I guess I don't have a hang of it. So if there is already a query written then yes, that would be of great help else if there is an inbuilt feature that I am not aware of then that would save me time as well :) Commented Mar 28, 2014 at 4:33
  • 2
    Are you looking for answers written by you, or overall on the site? Also, "the number of questions answered" and "the number of answers" may be different in general. Commented Mar 28, 2014 at 5:11
  • 1
    @cheapeffectivedietpills: Answers written by me. One moment. I will update the question. Commented Mar 28, 2014 at 11:25

2 Answers 2

3

I think You need this query

SET NOCOUNT ON

SELECT SUBSTRING(CONVERT(VARCHAR(11), A.CreationDate, 113), 4, 8) AS Date, Count(A.Id) AS Answers

FROM Posts AS A INNER JOIN Users AS U ON A.OwnerUserId=U.Id
WHERE A.ParentID Is Not Null AND U.Id = ##UserId##
GROUP BY SUBSTRING(CONVERT(VARCHAR(11), A.CreationDate, 113), 4, 8)

Number of Questions answered by Users In MonthWise

Output Would be

enter image description here

2
  • 1
    Thanks for taking time to answer my query. Let me go through it and I will get back to you in sometime. I am in a conference and may take some time to reply. Commented Mar 28, 2014 at 11:26
  • 1
    Simply Perfect! :) Thanks again for your time. Commented Mar 28, 2014 at 11:36
2

I have created a query in Data.SE for Month wise number of answers by User

SELECT DateName( month , DateAdd( month , MONTH(CreationDate) , -1 ) ) AS [Month]
     , YEAR(CreationDate) AS [Year]
     , COUNT (Id) AS Answers
  FROM Posts
 WHERE OwnerUserId = ##UserId##
   AND PostTypeId = 2
 GROUP BY MONTH(CreationDate) , YEAR(CreationDate)
 ORDER BY YEAR(CreationDate) ASC, MONTH(CreationDate) ASC

Result sample:

Month     Year Answers 
--------- ---- ------- 
May       2012 2       
June      2012 10      
July      2012 15      
August    2012 83      
September 2012 60      
October   2012 35      
November  2012 24      
December  2012 12      
January   2013 6       
February  2013 2       
March     2013 3       
April     2013 28      
May       2013 45      
June      2013 14      
July      2013 60      
August    2013 38      
September 2013 25      
October   2013 1       
January   2014 1  
5
  • 1
    Thanks for taking time to answer my query. Let me go through it and I will get back to you in sometime. I am in a conference and may take some time to reply. Commented Mar 28, 2014 at 11:27
  • @SiddharthRout - Sure but maximum time you can take is 6 to 8 weeks. :)
    – Himanshu
    Commented Mar 28, 2014 at 11:28
  • I tried your query with my User ID 1140579 and it didn't give me any results. However @VigneshKumar's query gave me the results as I wanted. I am just trying to understand both the queries and doing a few random checks to verify the output Commented Mar 28, 2014 at 11:34
  • @SiddharthRout - You probably used it in Meta Stack Overflow. I have updated the link.
    – Himanshu
    Commented Mar 28, 2014 at 11:37
  • 2
    + 1 Works perfectly now :) Commented Mar 28, 2014 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .