Re: Help on century

From: Bob <zaphod_at_mail.ameritel.net>
Date: 1996/07/22
Message-ID: <7167cc$7208.36c_at_NEWS>#1/1


lsantos_at_centroin.com.br (Luis Santos) wrote:

> I'm with a problem. My users application does insert with date field
>using only the two last digits of the year. When this is done Oracle
>assumes that the year is in the current century. An insert with the
>date 15/01/96 (dd/mm/yy format) will insert 15-jan-1996, and an insert
>with the date 15/01/01 (dd/mm/yy format) will insert 15-jan-1901.
 

> They want Oracle assumes the century that prodeces the year nearest
>the current year. In the example above, the 15/01/01 will insert
>15-jan-2001, because this date is more near sysdate than 15-jan-1901.
 

> How can we do it?
 

> Thanks,

If you look at the valid date formats in the manual (which one I can't remember) you'll see a format for the year called 'RR' as in 'DD-Mon-RR'. If you were to input '10-Jul-01' Oracle would know that you really mean '10-Jul-2001.' Pretty cool except that it only works in SQL*Plus--not in SQL*Forms. At least not in Forms 3.0, it may work in Forms 4.X, I haven't tried

What we ended up doing was forcing users to type the extra two digits for the year..

Bob J.. Received on Mon Jul 22 1996 - 00:00:00 CEST

Original text of this message