Hi,i Have the following SQL StatementSelect * from dtree WHERE Subtype=848 AND(MODIFYDATE between to_date(%2,'dd/mon/yyyy HH24:MI:SS') AND to_date(%3,'dd/mon/yyyy HH24:MI:SS') )
the numnbers %1, %2, %3 are variables and they get the values from another application. It works so far, but there case I can't handle.If the date values (%2,%3) are empty.I want that my query finds everthing without considering the Date condition...I tried it with a CASE condition:Select * from dtree WHERE Subtype=848 ANDAND (MODIFYDATE between to_date(CASE LEN(%2)=0 THEN '03/Feb/2015 00:00:00' END,'dd/mon/yyyy HH24:MI:SS') AND to_date(CASE LEN(%3)=0 THEN '05/Feb/2015 00:00:00' END,'dd/mon/yyyy HH24:MI:SS') )
but it doesn't work. Has anybody an idea how I can handle emty values?