I am trying to migrate data from one table to other. The issue is my target table has type date yyyy-mm-dd where as the source table has type varchar mm/dd/yy
I tried a few thing but seems none worked.
I am trying this but seems to give null
select year((datecreated)) * 10000 + month((datecreated)) * 100 + day((datecreated)) from employee
Here employee is my table and datecreated is my column.
If someone has come across this please let me know how to fix it.
You can try the
STR_TO_DATEto convert a string to a date:Date format specifications (%m, etc) can be found here.