Re: Help on century
Date: 1996/07/22
Message-ID: <4svqt0$jfu_at_nn2.fast.net>#1/1
In <4stgl9$6vc_at_raptor.centroin.com.br>, lsantos_at_centroin.com.br (Luis Santos) writes:
> 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,
>
>
>
>
>Sincerely,
>
>--
>Luis Santos
>Relacional Consultoria
>Rio de Janeiro - Brazil
>
You could use the dd/mm/rr format which will do what you ask, but I suggest you use the RRRR which allows the user to input a 2 or 4-digit year and displays a 4-digit year so that they get used to seeing it and can verify that it is correct.
D. Scott Moyer, Jr. dmoyer_at_gpu.com (preferred for work) GPU Service Corporation dsmoyer_at_enter.net (preferred for home)Reading, PA Received on Mon Jul 22 1996 - 00:00:00 CEST