bradgrafelman;10898757 wrote:If you were using MySQL, you could also just execute this query:
UPDATE myTable SET new_date=STR_TO_DATE(old_date, '%M %e %Y')
can I run this query from directly within phpMyAdmin by just substituting the "myTable" with the name of my table, the "old_date" with the name of the column in which the date is stored and before I run the query change the structure of that column from string to DATE?
In other words in my database there is a table called 'reviews' and within that table a column called 'date' which is set to TEXT and contains strings. If I want to convert that into DATETIME format, can I do the following?
1. change the column type from TEXT to DATETIME
2. run this query from the SQL tab of phpMyAdmin:
UPDATE reviews SET date=STR_TO_DATE(date, '%Y-%M-%D %H:%m:$s')
is this correct?
can I do it on the same column and update all rows in that column? or do I need to create a new column to store the converted values?