select from * from tabelname where searchcondition=getdate()+1
或者 select from * from tabelname where searchcondition=dateadd(day,1,getdate())
本来是要给分的,后来发现是getdate()是把日期和时间都获得了,我怎么得到时间呢?谢谢!
今天: 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)
select from * from tabelname where searchcondition=dateadd(day,1,getdate())
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)