Reputation: 39
Might be simple but I am unable to resolve this.
I want to do a minus the date between 2 tables for validation- One is an external table. The external table has varchar2 for date column -format is 3/03/2014 6:00:28 AM table2 has a date datatype which is of format '03-MAR-2014 06:00:28'.
Can someone help me with this. I am getting errors like ORA29913, ORA 01830 etc while doing minus between 2 after doing a to_date of first string
Thanks,
Upvotes: 0
Views: 15849
Reputation: 179
for first date convert it like this
select to_date('3/03/2014 6:00:28 AM','DD/MM/YYYY HH:MI:SS PM') from dual
and then you can subtract date from table2 directly from this date without need for any conversion.
Upvotes: 3