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: Date Columns

Re: Date Columns

From: Jason Judge <jason.judge_at_virgin.net>
Date: Thu, 21 Oct 1999 23:05:14 +0100
Message-ID: <7uo22g$ll6$1@nclient15-gui.server.virgin.net>


Date columns (or DATE datatypes) do not have a format since they are a native date type. The format only comes into being when displaying the date. There is a default format - defined in one of the database initialisation

files - that is used if you do not specifiy a format. This is normally
DD-MON-YY, though more often than not a DBA will set it to DD-MON-RR or
DD-MON-RRRR to ensure better Y2K compliency.

Use the TO_CHAR and TO_DATE functions to convert between a date datatype and a character datatype.

So TO_CHAR(DateColumn, 'DD/MM/YYYY') will give you your format when you wish to select the value out of your table.

Regards,

Jason Judge

Andreas Köster <AKoester_at_DerPatriot.com> wrote in message news:3806C377.547A8B6E_at_DerPatriot.com...
> The standard format for the "DATE" datatype is "01-DEC-99". I think its
> the internal format that oracle uses.
> You can set the environment variable "NLS_DATE_FORMAT" to "MM/DD/YYYY".
> Then even an "select sysdate from dual" should bring you the wanted
> format.
>
> Andreas Köster
>
>
> Brandon Duncan schrieb:
>
> > Does anyone know the correct syntax to get a Date Column in the format
> > 'MM/DD/YYYY' (01/01/1999)?
> >
> > I'm using
> > Create Table XTable (
> > DateColumn DATE (10, 'MM/DD/YYYY'),
> > ......
> >
> > I get an error message, 'Missing right parenthisis."
> >
> > Any ideas?
> >
> > Brandon
>
Received on Thu Oct 21 1999 - 17:05:14 CDT

Original text of this message

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