Converting full date into datetime in sql

Still relatively new to the sql language and need a little help and guidance..

I have a table which has the date in this format (2015-09-09 00:00:00) but the code i wrote pulls the date like this (Sep 21 2015 12:00AM), I would like the date to reflect like this (2015-09-09 00:00:00)

UPDATE table1 
SET [Column 0] = (SELECT CAST(RIGHT(LEFT([Column 1], CHARINDEX('; EndTime', [Column 1] ) -1), 19) AS DATETIME) AS Date
                  FROM table1  
                  WHERE [Column 1] LIKE '%StartTime=%')

Any help/guidance would be most grateful


Source: sql

Leave a Reply