我在使用CONVERT进行转换时,报了错。想了下应该是时分秒的格式不对,这是我的数据格式 20170922095553,如何将它转换为2017-09-01 10:36:18.000 这种格式呀!
http://www.cnblogs.com/jimowutongyu/articles/4792127.html
convert(datetime,'2011-07-01 00:00:00.000',21)
http://www.cnblogs.com/jimowutongyu/articles/4792127.html
conventr(datetime,'2011-07-01 00:00:00.000',21) 我在本地跑的报的是下面的错 转换不行的吧 要用字符串拼接
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'convert'.
终于找到解决方案了! Select convert(datetime,substring(20170922095553,1,8))
我这边正常这 试了可以 没什么问题