Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Date comparison question
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.
-----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
-- 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).Received on Mon Jan 08 2001 - 14:33:21 CST