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!

Added a TO_CHAR function and now my between clause is not working

1026398Sep 3 2013 — edited Sep 6 2013

Does anyone have any idea as to why this would happen and what the fix is? I'm using version 11.2.0.3.0. Thank you.

Initial query: this one runs fine and returns about 500 rows within set parameters

select *

from table

where column_name = '..'

and column_name

between '03-Sep-2013' and '13-Sep-2013'

Query with added TO_CHAR: this runs, but it runs as if it had no between clause and returns over 5k rows

select *

from table

where column_name = '..'

and to_char(column_name, 'MM/DD/YYYY hh24:mi:ss')

between '03-Sep-2013' and '13-Sep-2013'


Please only post 'helpful' information. I am new to this (literally just in SQL Developer for about a week with no prior knowledge of Oracle or PL/SQL and very limited knowledge with no practical experience of SQL).Please just try to help by offering helpful assistance and save your reply if you just want to criticize. Being completely new, what might be 'obvious' or easy to you probably is not to me. Thanks for understanding.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2013
Added on Sep 3 2013
18 comments
1,289 views