-- These all return 2011-01-01 23:59:59.997 SELECT CAST('2011-01-01 23:59:59.997' as datetime) SELECT CAST('2011-01-01 23:59:59.998' as datetime)
为什么以下查询到第二天呢?
-- Returns 2011-01-02 00:00:00.000 SELECT CAST('2011-01-01 23:59:59.999' as datetime)
> 997保持原样> 998将达到997> 999将达到000
为了获得更多的准确性,有sql Server 2008开始的DateTime2数据类型可以精确到7位小数.