Q:

Convert YYMDD into normal date

I have string '12B17T' which represents exactly YYMDDA (A is an irrelevant attribute).
For months, 1-9 is used for January to September; A-C is used for October, November, and December
The size of this string is fixed (e.g. if the date is January 1, 2012, it will look like '12101T')
How do I get something like 17.11.2012 from this using SQL?

A:

Try this;
DECLARE @x varchar(50)= '12B17T' 
SELECT  SUBSTRING(@x,4,2) +'-'+ 
   RIGHT( '0' + CASE SUBSTRING(@x,3,1) WHEN 'A' THEN '10'
                          WHEN 'B' THEN '11'
                          WHEN 'C' THEN '12' 
   ELSE SUBSTRING(@x,3,1) END, 2) +'-'+ 
   '20' + SUBSTRING(@x,1,2)

SQL Demo Fiddle here 
--Results 17-11-2012        

