-2

How to convert below string to datetime in sqlserver '19-MAR-2018 12:00'

2 Answers2

0

You can use CAST to take string to a DATETIME

SELECT CAST('19-MAR-2018 12:00' AS DATETIME)
Airn5475
  • 2,264
  • 27
  • 46
0

You can also use convert:

select convert(datetime, '19-MAR-2018 12:00', 100)
Krzysztof Atłasik
  • 20,861
  • 6
  • 47
  • 70
Y.K.
  • 672
  • 3
  • 10