日期:2014-05-18 浏览次数:20537 次
select * from tb where (datediff(hour,dt,getdate()) between 3 and 6) or (dt between '2007-12-01' and '2007-12-11')
------解决方案--------------------
select * from tb where 字段 between '2007-12-01' and '2007-12-11'
------解决方案--------------------
三小时,六小时,估计得用分钟来算才是你的本意. select * from tb where datediff(mi,时间字段,getdate()) <= 180 select * from tb where datediff(mi,时间字段,getdate()) <= 360 2007-12-01至2007-12-11 select * from tb where convert(varchar(10),时间字段,120) between '2007-12-01' and '2007-12-11'
------解决方案--------------------
2007-12-01至2007-12-11 select * from tb where 时间字段 between '2007-12-01' and '2007-12-11'