查询条件中有2个日期字段的范围,查询结果总为空,这是怎么回事?
这个语句错在哪?MonthPlan 是表名 ,BEGINTIME、ENDTIME 都是字段名。
select * from MonthPlan where BEGINTIME >= to_date('2003/9/11','YYYY-MM-DD') and ENDTIME <= to_date('2003/9/14','YYYY-MM-DD');总是没有返回记录。
但任意去掉一个条件 如:
select * from MonthPlan where BEGINTIME >= to_date('2003/9/11','YYYY-MM-DD'); 就有记录返回,
select * from MonthPlan where ENDTIME <= to_date('2003/9/14','YYYY-MM-DD'); 也有记录返回。
各位大侠,到底错在哪里?怎么实现有2个时间范围约束的查询效果?