title: sql query for monthly data
body: <p>I have written this query that gives day wise data of all 365 days of all 12 months when i select a year from drop down list.</p>
  
  <pre><code>SELECT
        YEAR(Date) AS [Year]
      , MONTH(Date) AS [Month]
      , COUNT(*) AS [Total]
  FROM EnquiryMaster
  WHERE EnquiryOwner = '" + enqowner + "'
       AND DATEPART(yyyy, Date) = '" + year + "'
       AND orgid = '" + orgid + "'
  GROUP BY
        YEAR(Date)
      , MONTH(Date)
  
  UNION ALL
  
  SELECT
        YEAR(Date) AS [Year]
      , NULL
      , COUNT(*)
  FROM EnquiryMaster
  WHERE EnquiryOwner = '" + enqowner + "'
       AND DATEPART(yyyy, Date) = '" + year + "'
       AND orgid = '" + orgid + "'
  GROUP BY YEAR(Date)
  </code></pre>
  
  <p>I want to write a query that will select month also along with year and display data only for that month</p>