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: Problem selecting where between 1999 and 2000

Re: Problem selecting where between 1999 and 2000

From: Jim Lyons <jlyons4435_at_my-deja.com>
Date: Wed, 16 Aug 2000 16:32:56 GMT
Message-ID: <8nefno$3ng$1@nnrp1.deja.com>

In article <8ned94$mf$1_at_nnrp1.deja.com>,   Maverick <topgun7443_at_my-deja.com> wrote:
> I am trying to select data using the following where clause:
>
> where to_char(start_ts,'MM/DD/YYYY') between '12/19/1999' and
> '08/15/2000'
>
> start_ts is defined as DATE.
>
> There is data that should be selected. The where clause works when
> using between '01/01/2000/ and '08/15/2000', but also fails when using
> between '12/31/1999' and '08/15/2000'.

Since you're doing a character compare, try using a conversion format of 'yyyy/mm/dd' and then use '1999/12/19' to '2000/08/15'.

--
Jim Lyons                     |  Network Systems Analyst
Entertech - The IC2 Institute |  512-482-0273, ext. 269
University of Texas at Austin |  jlyons_at_weblyons.com
http://www.weblyons.com


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Aug 16 2000 - 11:32:56 CDT

Original text of this message

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