-
Hi Friends,
I am trying to work out what the 'RR' Parameter in the to_data function represents. Can anyone please explain.
Also..
I entered the following in sqlplus :
select
to_date(SYSDATE,'DD-MON-YYYY RR')
from dual
and got the following error
ORA-01840: input value not long enough for date format
anybody know why?
What would be the correct syntax to display 'RR' as part of a date ?
What is it ?
Many Thanks
Suresh
-
Try either one of these:
select to_char(sysdate, 'DD-MON-RRRR') from dual;
select to_char(sysdate, 'DD-MON-YYYY') from dual;
to_char and not to_date
Good luck.
David Knight
OCP DBA 8i, 9i, 10g
-
Please explain
Hi,
These both outputted the same result.
Can you Please explain the difference between RRRR and YYYY
Thanks
Suresh
-
Hi, you must try this
to_date(sysdate,'DD-MON-RRRR')
Greets,
Sebastiaan
-
select to_char(to_date('27-OCT-98', 'DD-MON-RR'), 'YYYY') "Year"
from dual;
Would return the previous century:
Year
----
1998
On the other hand:
select to_char(to_date('27-OCT-98', 'DD-MON-YY'), 'RRRR') "Year"
from dual;
Would return current century
Year
----
2098
-
Hi,
RR code is used to round the century based on the current year and 2 digit year.
If current year is >=50 and 2digit year is <50,it rounds to next century.
If current year is <50 and 2digit year is>50,it rounds to previous century.
If the current year is >=50 and 2digit year is >=50 the century remains unchanged.
If the current year is <50 and 2digit year is <50 the century remains unchanged.
regards
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|