Query returns the wrong Value
select distinct TO_CHAR(op_date, 'MM-dd-yyyy'), svc_id, count(op_id_data1)
from tb_oper
where (oper_id=3050 or (oper_id=3014 and svc_id not in (select soc_id from tb_soc)) or (oper_id=3015 and svc_id not in
(select soc_id from tb_soc)))
and TO_CHAR(op_date, 'MM-dd-yyyy') >= '$P!{fromDate}'and TO_CHAR(op_date, 'MM-dd-yyyy') <= '$P!{toDate}'group by TO_CHAR(op_date, 'MM-dd-yyyy'), svc_id
order by 1,2
the from date and To date and values manually entered, but for example (06/01/2014 06/17/2014 , but i get data from 2013 also. please help.