I Have This Type Of Valuefe80::d235:a0ce:c3ce:b764%14:2/17/2023 12:29:34 PM
and I Want this Value As 02/17/2023 Using SQL
fivyi3re1#
try?
DECLARE @TestString VARCHAR(100) SET @TestString='fe80::d235:a0ce:c3ce:b764%14:2/17/2023 12:29:34 PM' SELECT REPLACE(LEFT(REVERSE(LEFT(REVERSE(@TestString),LEN(@TestString)-CHARINDEX('/',@TestString)+3)),10),':','')
eeq64g8w2#
Here is an example to convert your string into a Date.
SELECT FORMAT(CONVERT(datetime, 'fe80::d235:a0ce:c3ce:b764%14:2/17/2023 12:29:34 PM'), 'MM/dd/yyyy') AS formatted_date;
2条答案
按热度按时间fivyi3re1#
try?
eeq64g8w2#
Here is an example to convert your string into a Date.