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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

IF date range is given as Sysdate

Dir_PalFeb 15 2018 — edited Feb 16 2018

i have a oracle query where I have given multiple parameters for date range and its working if a specific range is given or if it is empty but the problem is when I have sysdate given I want to display all records it should ignore the date range

this is what I tried

Select hiredate,employee

from emp where deptno = 10

AND  hiredate BETWEEN NVL ( : p_Date_from, TO_DATE ('01.01.2000', 'dd.mm.yyyy'))

                            AND NVL (  : p_Date_to, SYSDATE + 1)

so if sysdate is present in : p_Date_from and : p_Date_to I want to see whole record where deptn=10.

This post has been answered by L. Fernigrini on Feb 15 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2018
Added on Feb 15 2018
6 comments
2,035 views