首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

怎么查询查询条件为明天的查询

2012-02-27 
如何查询查询条件为明天的查询.我知道查询查询条件为今天的查询的查询语句是:selectfrom*fromtabelnamewhe

如何查询查询条件为明天的查询.
我知道查询查询条件为今天的查询的查询语句是: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)

热点排行