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: help! DATE problem

Re: help! DATE problem

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Mon, 8 Mar 1999 20:44:32 +0100
Message-ID: <36e428a1$0$17515@newton>


kal121 wrote
>SELECT creation_date FROM my_table
>WHERE creation_date <= '01-JAN-99';

You can use trunc(..) to set the time part of the dates to 0:00:00 midnight. Also, please use to_date(..) to keep your query independend of any NLS_DATE_FORMAT settings:

    select creation_date
    from ...
    where trunc(creation_date)

        <= to_date('01-Jan-1999', 'DD-Mon-YYYY');

Alternatively, you could forget the trunc(..) by using < instead of <= and 02-Jan instead of 01-Jan.

> to_date('09-03-99 01:52:30', 'DD-MM-YY HR24:MI:SS')

HR24 is not the correct date format; use HH24 instead. Also, by now you should really stop using YY. If you insist on using two digits for the year then at least use RR or RRRR.

Arjan. Received on Mon Mar 08 1999 - 13:44:32 CST

Original text of this message

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