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!

Query for future dates returning data

700833Sep 14 2011 — edited Sep 14 2011
Hi,
I am not sure why this is happening. I ran the following query in 3 separate databases supporting 3 diff applications on various tables. Some tables return data the others dont. I picked the tables randomly.
The column 'createdt' stores the date on which the row was inserted.
select * from <tablename> where to_char(createdt,'mm/dd/yyyy') between '01/04/2012' and '03/08/2012';
when the query is changed to:
select * from <tablename>  where to_char(createdt,'yyyy') between '2012' and '2013';
It consistently returns no data, as it should.

Anyone knows why this is happening?

Thanks.
This post has been answered by Kim Berg Hansen on Sep 14 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2011
Added on Sep 14 2011
4 comments
1,858 views