日期:2014-05-19  浏览次数:20415 次

如何查询查询条件为明天的查询.
我知道查询查询条件为今天的查询的查询语句是:select   from   *   from   tabelname   where   searchcondition=getdate()
那么如果查询的条件为明天呢!
急,请高人帮助.

------解决方案--------------------
select from * from tabelname where searchcondition=getdate()+1
------解决方案--------------------
今天:
select from * from tabelname
where searchcondition
between Convert(datetime, SubString(Convert(varchar(30), getdate(), 120), 1, 10) + ' 00:00:00 ')
and Convert(datetime, SubString(Convert(varchar(30), getdate(), 120), 1, 10) + ' 23:59:59.999 ')

明天的把getdate()改成dateadd(day,1,getdate())就可以了
------解决方案--------------------
--得到日期
select from * from tabelname where searchcondition=convert(char(10),getdate()+1,120)
select from * from tabelname where searchcondition=convert(char(10),dateadd(day,1,getdate()),120)