title: Using GROUP BY with dates
body: <p>I have an invoice date column in my table which contains data as below</p>
  
  <pre><code>20150131
  20150231
  20160128
  20161231
  </code></pre>
  
  <p>I want to group the data based on the year of the transaction... i.e 2015 or 2016. My column type is <code>nvarchar</code>.</p>
  
  <p>Can someone please help. I am using SQL Server 2012.</p>