can i use substring in select as SELECT ' ' + substring('221415525', 1, 2) + ':' + substring('143825', 3, 2) + ':' + substring('143825', 5, 2), name from mytable
DECLARE @STR AS NVARCHAR(MAX) = '221415525' SELECT CONVERT(DATETIME, SUBSTRING(@STR, 1, 2) + ':' + SUBSTRING(@STR, 3, 2) + ':' + SUBSTRING(@STR, 5, 2) + ':' + SUBSTRING(@STR, 7, 2), 114)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)