How can I convert a String to a Date in T-SQL?
My test case is the string: '24.04.2012'
By default, Java dates are in the ISO-8601 format, so if we have any string which represents a date and time in this format, then we can use the parse() API of these classes directly.
CONVERT(datetime, '24.04.2012', 104)
Should do the trick. See here for more info: CAST and CONVERT (Transact-SQL)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With