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!

SQL statement to compare dates and return boolean (yes/no)

981609Jun 3 2013 — edited Jun 3 2013
I am looking for a SQL statement that can compare 2 dates and return a boolean. 1 (yes) if date 1 is => date2-threshold or 0 (No) if date < date2-threshold

Ie

date1=20130603
threshold=2 days
date2=sysdate-threshold


if [ 20130603 > sysdate-$threshold ]
then
return 1
else
return 0
fi

Thanks to all that answer.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2013
Added on Jun 3 2013
10 comments
5,019 views