问个时间查询有关问题

问个时间查询问题怎么查某表一次性从2011-10-15号到2011-11-04号的08:30到09:00的全部记录这样写只能查出

问个时间查询问题
怎么查某表一次性从2011-10-15号到2011-11-04号的08:30到09:00的全部记录
这样写只能查出这一天的,怎么才能一次性查出呢 ??

SQL code
select distinct a.test, a.test2, a.test3, a.test4,a.time  from testtime a where a.test1 in ('11', '22')   and a.time between to_date('2011-10-15 08:30', 'YYYY-mm-dd hh24:mi') and       to_date('2011-10-15 09:00', 'YYYY-mm-dd hh24:mi')


[解决办法]
SQL code
select distinct a.test, a.test2, a.test3, a.test4,a.time  from testtime a where a.test1 in ('11', '22')   and a.time >= to_date('2011-10-15 00:00', 'YYYY-mm-dd hh24:mi')    and a.time < to_date('2011-11-05 00:00', 'YYYY-mm-dd hh24:mi')   and to_char(a.time,'hh24:mi') between '08:30' and '09:00' ;