I have about 2 million rows in my table with a column for dates… this column is of type VARCHAR, and it contains a wrong date format, we have this format dd/mm/YYYY and it must be YYYY-mm-dd…
How can I change it? Remember it is a Varchar column, not a Datetime column (and it can’t be datetime field because we manipulate it with our queries)
Thank you in advice.
UPDATE
As I said, I have MILLIONS of rows, so it’s not possible to query one by one the date field to a new one, as you said in your responses…. I need some kind of “automatic” mode to transfer every row to it’s new format and datatype column.
If your end goal is just cleanup to end up in a datetime column, you only need to add a new column, then transfer the data:
Query:
Sample table:
Sample Result: