Between clause
773380Jun 7 2010 — edited Jun 8 2010Hi All,
In the where clause I am using between clause for date to be validated as below. My problem is whenver the user leaves the :reportfield1 and :reportfield1 leaves blank, it should default to sysdate and should show todays records but the condition fails. How to change the below where clause to include todays records
Please help. Hope I am clear if not please let me know
WHERE CLAUSE
----------------------
where datefieldname between nvl(:reportfield1,sysdate) and nvl(:reportfield2,sysdate)
here
------
datefieldname -- is the database varchar2 column
:reportfield1 -- a date is entered by the user in the report --varchar2 column
:reportfield2 -- a date is entered by the user in the report --varchar2 column