title: Comparison between Timestamp and date giving error ora-01852
body: <p>There is one table which has date column of type varchar2. The format of values in this field is : 2013-12-19T12:12:23.345000000Z
  I have to find the difference between two successive dates. But as the dates are in string format, I first convert it to timestamp. I use following query for the same.</p>
  
  <pre><code> select dccontextid,
          to_timestamp(substr(cdate,1,10)||' '||substr(cdate,12,12),'yyyy-mm-dd hh24:mi:ss.ff')
     from cam6eng.ttestcolorproc_wd
    where to_timestamp(substr(cdate,1,10)||' '||substr(cdate,12,12),'yyyy-mm-dd hh24:mi:ss.ff') between :StartDate and :EndDate
  </code></pre>
  
  <p>If the above query is run without including where clause, it shows proper timestamp values. But the moment I put where clause, it gives error ORA-01852 Seconds must be between 0 and 59.
  (This is because some records have second=59 and fraction=some nonzero value)</p>
  
  <p>What can be a workaround for this issue ?</p>