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: Dates

Re: Dates

From: Mladen Gogala <mladen_at_wangtrading.com>
Date: Fri, 25 Jun 2004 11:51:25 -0400
Message-ID: <20040625155125.GA6154@mladen.wangtrading.com>

On 06/25/2004 11:35:49 AM, Oracle wrote:
> Hi
>
> Can any please explain the reason for the differing results in the folowing
> queries

I can, as well as the oracle documentation. Read the fine manuals, please.

>
> 1)
> SELECT NCSN, NC_DATE_CLS FROM NONCONFORM WHERE NC_DATE_CLS LIKE '25-JUN-04'
>
>
> NCSN NC_DATE_CLS
> --------- ---------
> 3298 25-JUN-04
> 3299 25-JUN-04
>
> 2)
> SELECT NCSN, NC_DATE_CLS FROM NONCONFORM WHERE NC_DATE_CLS = '25-JUN-04'
>
> no rows selected

Date usually contains things line hours, minutes and seconds. Testing to equality should involve "trunc" or to_char functions. Your next question to this list should be: "what does the TRUNC function do"?

>
>
> 3)
> SELECT NCSN, NC_DATE_CLS FROM NONCONFORM WHERE NC_DATE_CLS between
> '25-JUN-04' AND '25-JUN-04';
>
> no rows selected

And what dates do you expect to be between 25-jun-04 00:00:00 and 25-jun-04 00:00:00?

>
> 4)
> SELECT NCSN, NC_DATE_CLS FROM NONCONFORM WHERE NC_DATE_CLS between
> '24-JUN-04' AND '26-JUN-04'
>
> NCSN NC_DATE_CLS
> --------- ---------
> 3298 25-JUN-04
> 3299 25-JUN-04
I don't see anything wrong here.

>
>
> Table nonconform....columns....NCSN NUMBER, NC_DATE_CLS DATE......
> Oracle 8.1.7

Don't be so verbose, please.

-- 
Mladen Gogala
Oracle DBA



Note:
This message is for the named person's use only.  It may contain confidential, proprietary or legally privileged information.  No confidentiality or privilege is waived or lost by any mistransmission.  If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender.  You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity.

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Jun 25 2004 - 10:48:21 CDT

Original text of this message

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