null 转换为别的类型,并比较大小
select 1
where convert(datetime,'2014-10-16',120) < getdate() and getdate() < convert(datetime,null,120)
结果为
-----------
(0 行受影响)
select 1
where convert(datetime,'2014-10-16',120) < convert(datetime,'2014-11-16',120)
结果为
----------- 1
(1 行受影响)
select convert(datetime,null,120)
结果为
----------------------- NULL
(1 行受影响)

浙公网安备 33010602011771号