Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Date in where clause

772087May 10 2010 — edited May 10 2010
Hello all,

I am new to Oracle, currently using 10G + aspvbscript.

I've been trying to query data using date in where clause but nothing seems to work.

The column is in date format.

It gets printed out like this: 5/1/2010 11:21:19 AM


I tried using this query:

SELECT * from table where TRUNC(user_date) > to_date('FEB-01-2010:00:00:00','mm-dd-yyyy:HH24:MI:SS') order by user_date asc.

It does return an output but it returns everything in table and does not take WHERE clause into consideration however, it does sort the date in ascending order.

I've tried getting rid of TRUNC tried to format date in a different way but no such luck.

Please point me to the right direction.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2010
Added on May 10 2010
8 comments
31,415 views