记得前几天 当表里的数据截止日为2014-01-09时候
between and查询 2014-01-01-----2014-01-10 返回0啊...
分享到:更多
------解决方案-------------------- 把A2弄到前面比较一下呗
SELECT CASE WHEN MAX(rjsj) < '2014-01-11 23:59:59.000' THEN 0 ELSE COUNT(*) END
FROM rk_day_info WHERE rjsj BETWEEN '2014-01-01 00:00:00.000' AND '2014-01-11 23:59:59.000'