conversions like this are a pain; obviously, whenever possible, this kind of data should be placed in a datatime filed, instead of a varchar/char; if you can, convert your original datasource to save you trouble in the future, but I know from experience that is not always possible.
here's one way to do it:
declare @notARealDate char(6)
Set @notARealDate= '081709'
--arbitrary cuttoff: anything that would be 51-99 is century 1900, else century 2000
SELECT CASE
WHEN CONVERT(INT,RIGHT(@notARealDate,2)) > 50
THEN '19' + RIGHT(@notARealDate,2) + LEFT(@notARealDate,4)
ELSE '20' + RIGHT(@notARealDate,2) + LEFT(@notARealDate,4)
END
Lowell