: We have various programs (PL/SQL, SQL, FORMS/3 and REPORT/1), that we
: must to convert to year 2000.
: Same tests were done, but the results were not good.
: Anybody knows how we can work with the function to_date, that dates are
: stored with 2 positions for year, and convert for 4 positions.
: Please, send us a answer.......
: Address: amsantos@intra.singer.com.br

Angela,

To convert a string to a date format (for inserting into a DATE field), use:

TO_DATE(string,'DD-MON-YYYY')

To convert a date field (such as SYSDATE) to a string, use:

TO_CHAR(date_field,'DD-MON-YYYY')

This will assume a date in the format of "18-SEP-1997". There are other options for
formatting. See my web page more much more information on this subject.

-Ari Kaplan
Independent Oracle DBA Consultant

<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 105+ Oracle tips, visit my Web Page:                      <->
<->                                                               <->
<->             www.arikaplan.com                                 <->
<->                                                               <->
<->             email: akaplan@interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->

Back to Ari Kaplan's Home Page >Back to Ari Kaplan's Home Page