Reputation: 39
I want to find the date from one given date to today date . But my code doesent show anything.Any tipp?
select * from orders
where order_date between to_date('2014-06-09','yyyy-mm-dd') and to_date(sysdate,'yyyy-mm-dd')
Upvotes: 1
Views: 48
Reputation: 49260
When you do to_date(sysdate,'yyyy-mm-dd')
, the year
part would be 0015
instead of 2015
. Hence you don't get any results.
Use trunc(sysdate)
instead.
Upvotes: 1