I'm having trouble figuring out a solution to this. I have several tables in my database with attributes having a date
type. However, in one of my tables I was not thinking during the design process so the attribute is not of date
but is a varchar
. The dates in the "incorrect" table is formatted as dd-MMM-yyyy whereas all of the other dates are formatted as yyyy-mm-dd.
How can I run through the "incorrect" column and do CAST(myDate AS date)
on each mis-typed attribute?