title: "Literal does not match format string" when comparing two date fields
body: <p>I have a weird behavior going on here, and I'm hoping someone can explain it to me.</p>
  
  <p>I have two fields in a query. One is a numeric field that is converted to a date by taking <code>to_date('01/01/1960', 'mm/dd/yyyy') + somethingorother</code>. Another is a text field, which includes at least one non-date value, that is converted to a date with <code>to_date(textField, 'mm/dd/rrrr')</code>. If I run the query, it runs fine. However, if I enclose the query in <code>select * from ( ) where field1 &gt; field2</code>, it blows up with an "ORA-01861: literal does not match format string" error. If I try excluding the known non-date value in the where clause of the subquery that pulls back the text field, it doesn't help.</p>
  
  <p>I know this is almost impossible to figure out without code, but I'm wondering if anyone can explain to me why it works without the filter, but blows up when I add it. Thanks.</p>