如何使用以#开头的样式109将Big Int转换为datetime
mon dd yyyy hh:mi:ss:mmmAM
632979854880200000是Big INT
select Convert(Datetime,((632979854880200000 - 599266080000000000) / 864000000000),109) AS Datetime
from Abc
答案 0 :(得分:0)
示例强>
select ViaConvert = Convert(varchar(30),Convert(Datetime,((632979854880200000 - 599266080000000000) / 864000000000.0)),109)
,ViaFormat = Format(Convert(Datetime,((632979854880200000 - 599266080000000000) / 864000000000.0)),'MMM dd yyyy hh:mm:ss tt')
<强>返回强>
ViaConvert ViaFormat
Nov 1 2006 1:44:48:017PM Nov 01 2006 01:44:48 PM