sql server 2012 - Parsing Dates in SQL -
i have column in database varchar. data looks this:
thu, 4 jul 2013 09:18:24 thu, 11 jul 2013 10:07:01 tue, 28 jan 2014 11:38:37 fri, 26 jul 2013 14:13:42
i want able convert date can recent record.
sql server 2012 onwards, can use try_parse
:
-- if culture argument isn't provided, language of current session used. select try_parse('thu, 4 jul 2013 09:18:24' datetime2) 'datetime2';
try_parse: returns result of expression, translated requested data type, or null if cast fails.
Comments
Post a Comment