Hi All,
One of our old application was storing date time as TEXT format. Some of the values in DB for column called 'datetime TEXT" column are
5/15/2018 2:57 PM GMT-04:00
5/15/2018 2:57 PM GMT-05:00
3/12/2018 5:25 PM EDT
2/6/2018 1:48 PM EST
Recently we are trying to add new column to store this value. Just say "dateTime" column with datetime type. On doing so we will be storing in datetime format for all new request after this update. But for older request the value will be in TEXT format as mentioned above.
Can anyone suggest best way to convert and populate datetime for older request into the new column which i have created.
Discussion posts and replies are publicly visible
Backup the entire table first. Then, try to run the below query on smaller data before you run it on the entire table.
UPDATE table_name SET dateTime = CONVERT(datetime, dateTime(TEXT), 120);