我有点生疏,似乎完全忘记了如何做到这一点。我正在接收数据,datatime列采用字符串格式char(12)
。SQL Server查询(查看)将字符串转换为DateTime
例子:201411061900
我将如何编写查询(视图)将其转换成DateTime
?
我用CONVERT (datetime, dbo.KWH.mr_dtm,120)
,但我得到的错误Conversion failed when converting date and/or time from character string.
我没有多少运气。非常感谢你提前。
如果你想建议-5时区也,我不介意。 :)