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 -> compare round(date)s

compare round(date)s

From: David Zlotchenko <zlotchen_at_voyager.rtd.utk.edu>
Date: 26 Dec 1999 15:43:09 GMT
Message-ID: <845d2d$512$1@penn.dii.utk.edu>


Hi,

I a puzzled by behavior of my Oracle 8.0.4.

I have table with field DATE field axtime. Here are two queries that return different results:

SQL> select count(*) from atable partition(PART19991121)  2 where round(axtime) <
round(to_date('1999/11/22','YYYY/MM/DD'));

  COUNT(*)


      9648

SQL> select count(*) from atable where axtime < round(to_date('1999/11/22','YYYY/MM/DD'));

  COUNT(*)


     53565

What makes these two queries to return different counts?

Here is my sessions' setting for date:
SQL> select round(to_date('1999/11/22','YYYY/MM/DD')) from dual;

ROUND(TO_DATE('1999/



22-Nov-1999 00:00:00

As far as I can see, round() works as I would expect making the date at 0 am.

Any suggestion will be appreciated. David.
--
--

David Zlotchenko
E-mail: zlotchen_at_cs.utk.edu
WWW: http://www.oars.utk.edu/~zlotchen Received on Sun Dec 26 1999 - 09:43:09 CST

Original text of this message

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