SqlServer2000的日期查询sql问题
下了个客户端-导航猫(Navicat),连接SqlServer2000,有一张表,其中PassDate 是日期类型(2012-01-01 15:32:12) ,总共有900多条数据,我截取一段时间内的数据,sql如下:
SELECT * from PassRecords where PassDate BETWEEN '2012-02-07 00:00:00' and '2012-02-09 23:59:59';
SELECT * from PassRecords where PassDate BETWEEN cast('2012-02-07 00:00:00' as datetime) and cast('2012-02-09 23:59:59' as datetime);