SQL Text to Date error
Posted on 2014-10-30
I have a text column called readdate which is text(6). It is actually a date that is formatted yymmdd. I need to convert this column to date. Here is what I have:
,convert(date,readdate,12) as DATEOFREAD
FROM openquery(UDB,'select * FROM ATABLE');
While it is executing, DATEOFREAD comes up with the format of XXXX-XX-XX, but then errors with this:
Conversion failed when converting date and/or time from character string.