I wrote a query that I use in the apex oracle, in which I added filters, but when I add a date selection this query does not work (although there are no syntax errors). I'll be grateful for the help

```
select eb.ID,
       eb.NAME,
       eb.TEMP,
       eb.ID_TRANS,
       eb.CR_DATE,
       eb.DATE_TMRT,
       ah.name as Silo_name,
       we.name as ORGANIZATIONS,
       ad.name as item
              from TEMPR_SILO  eb
              left join  ORGANIZATIONS we on  eb.ORGANIZATIONS =  we.id
              left join  ITEM_CRITICALTEMP ad on  ad.id <> 0 
              left join  silo ah  on  ah.id = ad.id_silo 
where   (:P115_ORG is null or we.name = :P115_ORG) 
and (:P115_SILO_NAME is null or  ah.name = :P115_SILO_NAME) 
and  to_timestamp(eb.DATE_TMRT)  between to_timestamp(:P115_DATA1,'dd.mm.yyyy') and to_timestamp(:P115_DATA2,'dd.mm.yyyy') 
------ when "OR" is missing then everything works ---
or   (:P115_DATA2 is null OR :P115_DATA1 is null)
group by
       eb.ID,
       eb.NAME,
       eb.TEMP,
       eb.ID_TRANS,
       eb.CR_DATE,
       eb.DATE_TMRT,
       we.name,
       ah.name,
       ad.name  

```

But filtered dates may not be specified, and I need all records to be available, and therefore "OP" should be. I would be grateful if you could help me find the error!