title: Unhelpful Oracle error message: expected %s, got %s using to_date
body: <p>Here is a simple query:</p>
  
  <pre><code>SELECT COUNT(*) FROM m_bug_t 
  WHERE date_submitted BETWEEN TO_DATE('2011-08-22','yyyy-mm-dd') AND TO_DATE('2011-08-29','yyyy-mm-dd') 
  AND status != 100
  </code></pre>
  
  <p>that gives the following error message </p>
  
  <pre><code>ORA-00932: inconsistent datatypes: expected NUMBER got DATE
  00932. 00000 -  "inconsistent datatypes: expected %s got %s"
  *Cause:    
  *Action:
  Error at Line: 2 Column: 22
  </code></pre>
  
  <p>Any ideas?  I'm using to using MySQL where this works even without the to_date function.</p>