Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Between clause

773380Jun 7 2010 — edited Jun 8 2010
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 6 2010
Added on Jun 7 2010
9 comments
1,513 views