Skip to Main Content

DevOps, CI/CD and Automation

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!

Not able to compare a date with sysdate in an .rtf template

727957Oct 14 2009 — edited Oct 14 2009
Hi,
Could anyone help me, how to compare a date with sysdate in an .rtf template.
Below is my scenario:
----------------------------
Working on PO Print report (PO Out for Communication).
In one of the field I need the below logic.

if expiration_date < sysdate then 'Expired'
else if line_location_id != '' then 'Hello'
else UNIT_PRICE end if

I am trying the below code:

<?xdofx:if EXPIRATION_DATE < sysdate('DD-MON-YYYY HH24:MI:SS') then 'Expired' else if LINE_LOCATION_ID!='' then 'See Below' else UNIT_PRICE end if?>

Irrespective of expiration_date it is printing 'Expired'.
But I want to print 'See Below' or UNIT_PRICE if expiration_date is higher than sysdate.
I even want to add one more condition if it works. If expiration_date is null then I would like to add one more day to the expiration_date.
EXPIRATION_DATE is coming as DD-MON-YYYY HH24:MI:SS.

I really appreciate if any one helps me.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 11 2009
Added on Oct 14 2009
1 comment
1,088 views