-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,452
  • 29
  • 51
0

You can also use convert:

select convert(datetime, '19-MAR-2018 12:00', 100)
Krzysztof Atłasik
  • 21,985
  • 6
  • 54
  • 76
Y.K.
  • 682
  • 4
  • 10