select出指定日期的数据怎么取?
数据库中已经有一字段为DateTime类型!(包含了时间)
现在比如我要取日期为'2002-10-01'的数据,不管时间是多少!
这个select语句应该怎么写?
楼主, 你是用那个sql server, 他们应该有不同的date function,
如我用 interbase 6 或 firebird 1, 会用
select * from tb
where cast(MyDateTime as date) = '2002-10-1';
sql server 2000
select * from table where column >'2002-10-1' and column<'2002-10-2'
select * from table where left(convert(varchar,column,120),10)='2002-10-01'