title: Group By Month and Year to get distinct month and years then combine as a single date SQL
body: <pre><code>SELECT CONVERT(DATE,CAST([Year] AS VARCHAR(4))+'-'+
                      CAST([Month] AS VARCHAR(2))+'-'+
                      CAST('1' AS VARCHAR(2))) Date 
  FROM (SELECT YEAR(Date) as [Year], MONTH(Date) as [Month] FROM [dbo].[Data] 
  GROUP BY YEAR(Date), MONTH(Date)) x
                      ORDER BY Date DESC
  </code></pre>
  
  <p>Is there a better way to doinq this with a single query?</p>
  
  <p>The query should return the unique month and year from a table but as combined Date.</p>