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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Date comparison question

RE: Date comparison question

From: Regina Harter <rharter_at_emc-inc.com>
Date: Mon, 08 Jan 2001 13:17:35 -0800
Message-Id: <10735.126059@fatcity.com>


At 12:32 PM 1/8/01 -0800, you wrote:
>Because, by default date fields do not return the TIME portion unless
>specifically requested to. So you check against run_date has no time
>portion so a match is not possible.

Sorry, but this is untrue. We have run into this many times. Even though the default date format for displaying dates does not include time, if a date field contains a time, it will still use the time portion when comparing it to another date.

>-----Original Message-----
>From: Lisa Yates [SMTP:cosnit_at_creighton.edu]
>Sent: Monday, January 08, 2001 2:27 PM
>To: Multiple recipients of list ORACLE-L
>Subject: Date comparison question
>
>
>Why doesn't this query ever return...
>
>where run_date = to_date('01-03-2001 16:34:59','mm-dd-yyyy hh24:mi:ss')
>
>but this query does....
>
>where to_char(run_date) = to_char(to_date('01-03-2001
>16:34:59','mm-dd-yyyy hh24:mi:ss'))
>
>and so does this query....
>
>where to_char(run_date,'mm-dd-yyyy hh24:mi:ss') = '01-03-2001 16:34:59'
>
>?
>
>TIA
>
>Lisa
>
>
>********************************************
>* Lisa Yates cosnit_at_creighton.edu *
>* Creighton University *
>* Omaha, Nebraska *
>* (402) 280-2419 fax: (402) 280-2573 *
>* Define the Universe, give 2 examples. *
>********************************************
>
>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Lisa Yates
> INET: cosnit_at_creighton.edu
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: William Rogge
> INET: William_Rogge_at_voltek.com
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).
Received on Mon Jan 08 2001 - 15:17:35 CST

Original text of this message

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