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!

Use RRRR or YYYY

MuzzFeb 28 2014 — edited Feb 28 2014

Hi Gurus

I have one date column and I'm trying to put nvl in case date is null so I think first I need to convert it into to_date and then need to apply nvl. Rite?

like this:

I think my my database NLS date format is 'DD-MON-YYYY' or DD-MON-RRRR ' because when I issue this command select sysdate from dual then it shows date in this fomat.

----------------------------

The problem is that when I issue select to_date( start_date,'DD-MON-YYYY')  from dual; command then I receive the following error message:

full year must be between -4713 and so on ..........................

...............

but when I changed it to select to_date( start_date,'DD-MON-RRRR')  from dual; then its working fine.

My question is that can I use use RRRR instead of YYYY and then convert it into by using nvl or omit to_date and directly convert it into my desired date format like below:

nvl(start_date,'31-DEC-4444'). Please guide

Regards

Shu

This post has been answered by AnnEdmund on Feb 28 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2014
Added on Feb 28 2014
14 comments
3,845 views