title: How to filter based on the date in Oracle SQL
body: <p>I had a query as below in my function. In that I need to filter based on the a.submit_date</p>
  
  <pre><code>SELECT mail_id , mail_async, mail_priority FROM glms_mail_sys_mail_store a
  WHERE                  
  --(TO_DATE(a.submit_date,'dd-MM-yyyy HH:mm') &gt;= '14-06-2012 18:30')
  --AND (TO_DATE(a.submit_date,'dd-MM-yyyy HH:mm') &lt;= '15-06-2012 18:50')
  
  (TO_DATE(TO_CHAR(a.submit_date,'dd-MM-yyyy HH:mm'),'dd-MM-yyyy HH:mm') &gt;= '14-06-2012 18:30')
  AND (TO_DATE(TO_CHAR(a.submit_date,'dd-MM-yyyy HH:mm'),'dd-MM-yyyy HH:mm') &lt;= '15-06-2012 18:30')
  </code></pre>
  
  <p>In My DB a.submit_date had a value as '14-06-2012 20:30'</p>
  
  <p>But its throwing Invalid month... can anyone help to correct this?</p>