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