How to parse string into date?

后端 未结 6 1864
闹比i
闹比i 2020-12-04 16:37

How can I convert a String to a Date in T-SQL?

My test case is the string: \'24.04.2012\'

6条回答
  •  生来不讨喜
    2020-12-04 16:57

    CONVERT(datetime, '24.04.2012', 104)
    

    Should do the trick. See here for more info: CAST and CONVERT (Transact-SQL)

提交回复
热议问题