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

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to enter a 'date' in SQL?

Re: How to enter a 'date' in SQL?

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 2000/06/09
Message-ID: <8hpfun$tnj$1@nnrp1.deja.com>#1/1

In article <394011EC.43240796_at_mediashell.net>,   leenick_at_bigfoot.com wrote:
> Hi,
>
> This is a newbie question ......
>
> How to enter a 'date' in SQL? What format should the date be in?
>
> Thanks very much,
> Nick
>

whatever you want. to_date( 'some string', 'some format' )

insert into t values ( to_date( '01012000', 'ddmmyyyy' ) )
insert into t values ( to_date( '01-jan-2000', 'dd-mon-yyyy' ) );
insert into t values ( to_date( '01/01/2000', 'dd/mm/yyyy' ) );

they all do the same thing. you pick the format you like best.

--
Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries
Howtos and such: http://osi.oracle.com/~tkyte/index.html
Oracle Magazine: http://www.oracle.com/oramag
Opinions are mine and do not necessarily reflect those of Oracle Corp


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jun 09 2000 - 00:00:00 CDT

Original text of this message

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