This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To fix a situation where you have a date formatted as 12/25/2015 in a varchar column type and want to store the correct date format in a date column, run the following query and then you can change the column type. UPDATE your_table | |
SET date_field = DATE(STR_TO_DATE(date_field, '%m/%d/%Y')) | |
WHERE DATE(STR_TO_DATE(date_field, '%m/%d/%Y')) <> '0000-00-00'; |