Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Newcomer's date question
Not to beat a dead horse, by why use the RR format when YYYY will avoid any future problems and is not a 'workaround' solution that limits your date ranges ( I use dates in many centuries)
Admittedly those with many apps that have the date format hard-coded to a 2 digit year would need extensive rewriting, but for new installations/Apps anything other then YYYY seems short-sighted...
Just my 2c
"Eugenio" <eugenio.spadafora_at_compaq.com> wrote:
>Try it.
>I did it, and it works because with RR the 81 in the query is rouded to 1981
>and not to 2081.
>
>Then the query with RR mask (session o statement level) works fine.
>
>Regards
>
>Eugenio
>
>"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
>news:961166265.21996.1.pluto.d4ee154e_at_news.demon.nl...
>> Just FYI
>>
>>
>> If you don't have the RR mask set in your date format, and you load the
demo
>> tables, the *current* century will be automatically used.
>> As right now the century in the date column is already wrong, using the RR
>> mask in selects will not help a bit.
>>
>> Regards,
>>
>> Sybrand Bakker, Oracle DBA
>>
>>
>> "Eugenio" <eugenio.spadafora_nospam_at_compaq.com> wrote in message
>> news:8icvno$29m$1_at_mailint03.im.hou.compaq.com...
>> > hahahahhahahha
>> >
>> > It's Friday !!!!!!!!!!!!!!!
>> >
>> > We are in 2000 !!!!!!!!
>> > Linda, check your DATE format settings.
>> > Probably your server/client doesn't have the RR settings for the year.
>> >
>> > And then you're querying
>> > between 01-MAY-2081 and 09-JUN-2081.
>> > Scott employee's data are related to the previous millennium.
>> >
>> > Your problem is...THE MILLENNIUM BUG !
>> >
>> > Run
>> > alter session set nls_date_format='DD-MON-RR';
>> > and your query will work.
>> >
>> > Otherwise use the RR setting in the query o 4 digit years in date
>> > formatting.
>> >
>> > WHERE hiredate between to_date('01-MAY-81 00:00:00', 'DD-MON-RR
HH24:MI:SS')
>> > and to_date('09-JUN-81 23:59:59',
>> > 'DD-MON-RR HH24:MI:SS')
>> >
>> > or
>> >
>> > WHERE hiredate between to_date('01-MAY-1981 00:00:00', 'DD-MON-YYYY
>> > HH24:MI:SS')
>> > and to_date('09-JUN-1981 23:59:59',
>> > 'DD-MON-YYYY HH24:MI:SS')
>> >
>> >
>> > FRIDAY !!!!!
>> >
>> > --
>> > be happy
>> >
>> > Eugenio
>> > remove _nospam from reply address
>> >
>> > Opinions are mine and do not necessarily reflect those of my company
>> >
>> > =======================================================
>> > Eugenio wrote in message <8icul4$1s6$1_at_mailint03.im.hou.compaq.com>...
>> > >Yes, it is !!
>> > >
>> > >I saw only the 9-JUN line !
>> > >
>> > >But for the 1-MAY line the original query should work !!!
>> > >
>> > >It's Friday
>> > >
>> > >--
>> > >be happy
>> > >
>> > >Eugenio
>> > >remove _nospam from reply address
>> > >
>> > >Opinions are mine and do not necessarily reflect those of my company
>> > >
>> > >=======================================================
>> > >Kathinka Diehl wrote in message <8ictrh$4ktvg$1_at_fu-berlin.de>...
>> > >>
>> > >>Eugenio <eugenio.spadafora_nospam_at_compaq.com> schrieb:
>> > >>>
>> > >>> to_date('01-MAY-81 00:00:00', 'DD-MON-YY HH24:MI:SS')
>> > >>
>> > >>But IIRC this is excactly the same as '01-May-81'.
>> > >>
>> > >>Mysterious.
>> > >>Kathinka
>> > >>
>> > >>
>> > >>
>> > >
>> > >
>> >
>> >
>>
>>
>
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =----- Received on Fri Jun 16 2000 - 00:00:00 CDT
![]() |
![]() |