不知道数据库操作中有没有日期累加的函数,不过在.net中可以先设定一个时间段:比如可以这样 System.DateTime dtstartTime=DateTime.Now(); System.DateTime dtendTime=dtstartTime.AddDays(3); Select * From 表 Where 日期>=dtstartTime And 日期<=dtendTime
declare @a table(times datetime) insert @a select '2007-10-16' union all select '2008-10-18' union all select '2007-10-17' union all select '2007-12-12' union all select '2007-10-18'
select * from @a a where times between a.times and dateadd(day,3,getdate())