title: SQL Server date dimension
body: <p>I am new to SQL Server. I want to know what is the proper statement to pull the previous year and quarter.</p>
  <pre><code>DECLARE @myvalue DATE = '2016-01-01'
  </code></pre>
  <p>The columns are:</p>
  <ul>
  <li><p><code>previous_year_and_quarter_num</code>: data type <code>smallint</code> and is numeric representation of the previous quarter and year corresponding to the Calendar Date, expressed as an integer, e.g. <code>20113</code> for a current date in the fourth quarter of 2011.</p>
  </li>
  <li><p><code>previous_year_and_month_abbr</code>: data type <code>varchar(30)</code> and is an alpha-numeric representation of the previous quarter and year corresponding to the Calendar Date, expressed as an integer, e.g. <code>2011 Q3</code> for a current date in the fourth quarter of 2011.</p>
  </li>
  </ul>
  <p>Could you please help me how to write SQL statement in SQL Server.</p>
  <p>Thank you.</p>