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

Home -> Community -> Usenet -> c.d.o.server -> Re: DATE in SQL

Re: DATE in SQL

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Mon, 22 Jul 2002 14:48:58 GMT
Message-ID: <tXU_8.625883$cQ3.100853@sccrnsc01>


You say:
to_date('19 07 2002','DD MM YY')
but look at the statement. You say you are going to give a 2 digit year and then give a 4. Change to:
to_date('19 07 2002','DD MM YYYY')

Always specify years with 4 digits, less ambiguity, and always use to_date for the constant part. If you do not then your code will break if someone changes the default date format on the client end. Jim

"kondor" <kondor_at_wanadoo.fr> wrote in message news:3D3C0099.4070100_at_wanadoo.fr...
> Hi,
> I want to execute a request that return me the rows where date is more
> recent than 2002-07-19 (19/07/2002 in french format) I try :
>
> select ARTID from ARTICLES a, PAGES p
> where a.PGID=p.PGID and
> a.PGVERSION=p.PGVERSION and
> p.PGDATEPUB > to_date('19 07 2002','DD MM YY')
>
> or :
>
> select ARTID from ARTICLES a, PAGES p
> where a.PGID=p.PGID and
> a.PGVERSION=p.PGVERSION and
> p.PGDATEPUB > date '19/07/2002'
>
> but It returns me an error.
>
> Can you help me ...
> THANKS .
>
Received on Mon Jul 22 2002 - 09:48:58 CDT

Original text of this message

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