title: Replace last two characters in column
body: <p>I have a column with dates in the format 201201, 201202, 201203 etc.</p>
  
  <p>This is a financial database so there is a period 13; however periods 12 &amp; 13 are combined for reporting purposes.</p>
  
  <p>When the last two characters are 13, how do I replace them with 12?</p>
  
  <p>I started off with</p>
  
  <pre><code>SELECT REPLACE(PERIOD, '13', '12')
  FROM @b_s_summary
  </code></pre>
  
  <p>but, of course this messes with the year when it's 2013.</p>
  
  <p>All advice gratefully received.</p>