A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Hi @coool sweet ,
Please refer to:
CREATE TABLE #test(dates char(25))
INSERT INTO #test VALUES('wed, 7 Apr 2021 14:42:25')
SELECT FORMAT(CAST(RIGHT(dates,LEN(dates)-CHARINDEX(',',dates)) as datetime2),'yyyy-MM-dd HH:mm:ss')
FROM #test
Output:
2021-04-07 14:42:25
If you want to update the column, then:
UPDATE #test
SET dates=FORMAT(CAST(RIGHT(dates,LEN(dates)-CHARINDEX(',',dates)) as datetime2),'yyyy-MM-dd HH:mm:ss')
FROM #test
If you have any question, please feel free to let me know.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.