Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to compare a date to sysdate
ramdan ha scritto nel messaggio ...
>why does this not work?!!?!?
>
>
>SQL> SELECT SYSDATE FROM DUAL;
>
>SYSDATE
>-----------
>02-mar-1999
>
>
>SQL> select * from tab1row where readdate = (select sysdate from dual);
>
>no rows selected
>
>SQL> select * from tab1row where readdate = sysdate;
>
>no rows selected
>
[snip]
Because the value of hours, minutes and so on into the table are not the
same of those of the sysdate...
Try this statement:
SQL> select * from tab1row where to_char(readdate,'dd-mon-yyyy') = to_char(sysdate,'dd-mon-yyyy');
or
SQL> select * from tab1row where to_char(readdate,'dd-mon-yyyy') = (select to_char(sysdate,'dd-mon-yyyy') from dual);
Bye Received on Thu Mar 04 1999 - 05:12:05 CST
![]() |
![]() |