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: SQL query

Re: SQL query

From: ST <tansokching_at_hotmail.com>
Date: Wed, 21 Nov 2001 09:47:03 +0800
Message-ID: <9tf143$k32$1@violet.singnet.com.sg>


if u use to_date to change to the date format... the min date will only be correctly displayed...
if compare directly( using the string format) the dd will be compared first... that's why it will not be accurate.

use min(to_date(end_date,'dd.mm.yyyy')) ........

longinus <longinus_at_zeus.polsl.gliwice.pl> wrote in message news:3BFA8CC6.E6270F11_at_zeus.polsl.gliwice.pl...
> No, it's in the dd.mm.yyyy format but as I observed not the whole didits
> of the string value are compared. As not the oldest date is chosen. Why
> is that?
>
> ST schrieb:
> >
> > if your end_date is in this format YYYYMMDD,
> > use min(to_date(end_date,'YYYYMMDD'))
> >
> > longinus <longinus_at_zeus.polsl.gliwice.pl> wrote in message
> > news:3BF9B6B3.FB1741FF_at_zeus.polsl.gliwice.pl...
> > > there is a problem as the End_date field is a string-type, and it
seems
> > > as it compares only first two digits of the string. how to make oracle
8
> > > to compare the whole string?
> > >
> > > longinus schrieb:
> > > >
> > > > How to choose using SQL language the record that has status 'not
> > > > reached' and the minimal end_date?
> > > >
> > > > table description:
> > > >
> > > > SQL> desc t_milestones
> > > > Name Null? Type
> > > > ------------------------------- -------- ----
> > > > NAME VARCHAR2(50)
> > > > DEADLINE VARCHAR2(10)
> > > > END_DATE VARCHAR2(10)
> > > > STATUS VARCHAR2(15)
> > > > MILESTONESID NOT NULL NUMBER(5)
> > > > PROJ_ID NUMBER
Received on Tue Nov 20 2001 - 19:47:03 CST

Original text of this message

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