I'm trying to run a select statement in SQL Developer that casts a field like 20160809 to a date. My query looks like:
select
  to_date(sale_date, 'YYYYMMDD') as sale_date
from properties
This is throwing an ORA-01839: date not valid for month specified. I've tried everything from substringing to regular expressions to try to deduce which value is causing the error, but no dice. Is there any way to execute this query and get the input to to_date that's causing it to fail?
 
     
     
     
     
    