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!

Need help in date to number conversion

user497267Jun 1 2009 — edited Jun 1 2009
Hi,

I have a doubt in a date conversion, please help me.

I executed the below query, its throwing "invalid number" error.

select * from test
where date_sid between to_number(to_char('01-05-2009','dd-mm-yyyy'),'yyyymmdd') and to_number(to_char('02-05-2009','dd-mm-yyyy'),'yyyymmdd')

date_sid column is number datatype.

In my above query i want to pass the date value like '12-05-2009'. If i check my table date_sid looks like yyyymmdd. So how to convert '12-05-2009' to 20090512 in my above query. Please help me.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2009
Added on Jun 1 2009
2 comments
732 views