I have 2 input fields as string from_date and to_date which is in format 'MM-dd-yyyy HH:mm:ss'. I have a table column reported_date which is again string and in format 'yyyy-mm-dd hh24:mi:ss'.
I tried
to_char(to_timestamp('01-01-2011 13:43:31','MM-dd-yyyy HH:mm:ss'),'yyyy-mm-dd hh24:mi:ss') as FROM_TIME, to_char(to_timestamp('30-05-2016 13:43:31','MM-dd-yyyy HH:mm:ss'),'yyyy-mm-dd hh24:mi:ss') as TO_TIME
and then "where to_timestamp(reported_date,'yyyy-mm-dd hh24:mi:ss') between to_timestamp(FROM_DATE, 'yyyy-mm-dd hh24:mi:ss') and to_timestamp(TO_DATE,''yyyy-mm-dd hh24:mi:ss')
im getting this error "format code appears twice"
I need a select query where reported_date between from_date and to_date.