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: Help!Select latest date.

Re: Help!Select latest date.

From: TurkBear <johng_at_nospam.mm.com>
Date: Fri, 19 Mar 1999 15:47:47 GMT
Message-ID: <36f270d9.3952393@news2.mm.com>


Try

select * from table where
trunc(date_field) = (select max(trunc(date_field)) from table);

Use the Trunc() function to avoid the time component section of the date field

Note: I haven't tried this code, but it should work...

"Prizant Lev A." <PrizantLA_at_BWSC.ORG> wrote:

>Hi,
>
>I'm trying to select a record or records from a recordset with the
>latest date.
>For example if there are 4 records with date fields:
>01-MAR-1999
>02-MAR-1999
>05-MAR-1999
>05-MAR-1999
>then I want to select all records where dates are '05-MAR-1999'.
>
>Thanks in advance!
>

To reply please remove the 'nospam' part of the address Received on Fri Mar 19 1999 - 09:47:47 CST

Original text of this message

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