select * from tab where ctime >= '2009-11-11 0:0:0' and ctime <= '2009-11-11 23:59:59'
在代码中你要用到FormatDateTime函数
sql server select * from tab where ctime = getdate()
SQL 里面下面的语句就能实现。 select * from tab where ctime = getdate()
select count(*) from tab where convert(char(8),ctime,112) = convert(char(8),getdate(),112) 试试这段
select * from tab where ctime=today
uses DateUtils;select * from tab where ctime=today
select * from tab where datepart(ctime,YYYY) = datepart(getdate(),YYYY) and datepart(ctime,MM) = datepart(getdate(),MM) and datepart(ctime,DD) = datepart(getdate(),DD)
select * from tab where ctime = getdate()
select * from tab where ctime = getdate()
试试这段
select * from tab where ctime=today
uses DateUtils;select * from tab where ctime=today