Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: to_date('01/01/97','dd/mm/yyyy')

Re: to_date('01/01/97','dd/mm/yyyy')

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/03/05
Message-ID: <5fj2vc$99f@shadow.CSUFresno.EDU>#1/1

In article <331CACB8.2781_at_garland.dnr.state.sc.us>,  <edwards_at_garland.dnr.state.sc.us> wrote:
>I have written an OCI text based data entry form.
>The problem is that too many people like to enter two digit
>years instead of four. How come oracle doesn't reject two
>digit years when I specify 4 digit years in the date picture??
>
>to_date('01/01/97','dd/mm/yyyy')

Oracle translates the above to 01-Jan-0097. Seems pretty dumb, but that's what they do. I'm not sure, but using 'dd/mm/rrrr' may work the way you want.

Nobody wants to enter the century. If they know that 97 means 1997, and that 00 means 2000, your program should, too. Write a routine to determine which they have entered, and infer the century from the 2-digit year.

I have a pl/sql function I have written just for that purpose. If you need it, I can dig it up.

Steve Cosner Received on Wed Mar 05 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US