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!

select statement where 'where' column contains Date column as string and parameters are also string

1102964Apr 20 2016 — edited Apr 20 2016

Below is my create and insert queries

create table sample

( id varchar2(256),

  reported_date varchar2(256)

)

insert into sample values ('123456','2016-03-18 04:18:56');

insert into sample values ('123456','2016-03-19 04:20:56');

i have 2 params start_date = '01-01-1990' and end_date='01-01-2090'. Both these params are strings.

I need a select the ids where reported_date are in the range of start_date and end_date ( all 3 are in string format).

select id from sample where reported_date between start_date and end_date;

Thanks,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2016
Added on Apr 20 2016
11 comments
773 views