I have a string field where 99% of the entries are in a format that can be converted to a date, i.e. To_DATE(' 20100501', 'yyyymmdd') would work great. However, about 1% of the entries are in as something like '00000000' or '00000500'. So when I try to apply the TO_DATE function to all of the values, i.e. SELECT TO_DATE(datefield, 'yyyymmdd') the result is an error because the year or month is not valid for some of the entries. I am at a loss for what to do here. Perhaps I can make the TO_DATE function part of a sub query after a date validation has been applied? Maybe convert those non date formats to something like 19000101 to avoid the error???