I have a string parsed from XML which represents datetime. String format is: '20200915114000' - (YYYYMMDDhhmmss)
Is there a function in SQL Server to convert or parse this string to datetime or should I split string manually and concatenate it into datetime?
How to do this, in 3 steps:
Conclusion you need to add a space and 3 ':' in the string to convert
'20200915114000'
to'20200915 11:40:00'
. After this a simple CONVERT will do the trick.