===查询某天所有数据===
方法1
select * from [article]
where Convert(varchar(10),[add_time],111) = '2017/04/22'方法2
select * from [article]
where Convert(varchar(10),[add_time],120) = '2017-04-22'===查询大于某一时间的数据===
select * from article
where add_time >= '2017-04-12 00:00:00'===区间查询===
方法1
select * from [article]
where [add_time] between '2017-04-01 00:00:00' and '2017-04-20 00:00:00'方法2
select * from [article]
where [add_time] >= '2017-04-10 00:00:00' and [add_time] <= '2017-04-20 00:00:00'===查询10天前的当天所有数据,精确到天===
select * from [article]
where datediff(dd,[add_time],getdate()) = 10===查询今天的当天所有数据===
select * from [article]
where datediff(dd,[add_time],getdate()) = 0










