Aug 06 2023 05:46 PM
I am unable to change the nvarchar type to datetime type 2023-08-03T02:00:31+00:00 please help
Aug 06 2023 11:03 PM
@Sajj_Mak use only the valid left part together with CONVERT and the date sytle 126 = ISO,
DECLARE @date nvarchar(50) = N'2023-08-03T02:00:31+00:00'
SELECT CONVERT(datetime, LEFT(@date, 19), 126)
See CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learn