title: Error "ORA-01830": date format picture ends before converting entire input string (Oracle Error)
body: <p>Please help, this my query:</p>
  
  <pre><code>SELECT   a.verifierid, a.peerverifier, periode AS last_periode,
           endToEndDelayMedian / 1000 AS x_medianroundtriplatency,
           medianJitter / 1000 AS x_maxjitter, percentLostPackets,
           CASE
  WHEN (endToEndDelayMedian / 1000) &lt; 80
  AND (endToEndDelayMedian / 1000) &gt; 0 THEN
      1
  WHEN 80 &lt;= (endToEndDelayMedian / 1000)
  AND (endToEndDelayMedian / 1000) &lt; 100 THEN
      2
  ELSE
      3 end as sign_latency,
           CASE
              WHEN (medianJitter / 1000) &lt; 5
              AND (medianJitter / 1000) &gt; 0
                 THEN 1
              WHEN 5 &lt;= (medianJitter / 1000)
              AND (medianJitter / 1000) &lt; 30
                 THEN 2
              ELSE 3
           END AS sign_jitter,
           CASE
              WHEN percentLostPackets &lt; 0.5
                 THEN 1
              WHEN 0.5 &lt;= (percentLostPackets)
              AND (percentLostPackets) &lt; 1
                 THEN 2
              ELSE 3
           END AS sign_packetlost,
           last_update
      FROM (select to_char(case when periode like '201%' then to_date(periode,'yyyy-mm-dd hh24:mi:ss')
  else to_date(periode,'mm-dd-yyyy hh24:mi:ss') end,'YYYY-MM-DD hh24:mi:ss') periodex, a.*
  from nextone_brix_l3vpn a ) a
           INNER JOIN
           (SELECT   verifierid, peerverifier, MAX (periode) AS last_periode
                FROM nextone_brix_l3vpn
            GROUP BY verifierid, peerverifier) b
           ON a.verifierid = b.verifierid
         AND a.peerverifier = b.peerverifier
         AND periode = b.last_periode
  where 1=1  and to_char(periodex,'yyyy-mm-dd hh24:mi:ss') between SYSDATE - INTERVAL '24' HOUR AND SYSDATE and rownum&lt;=10
  ORDER BY sign_packetlost DESC,
           sign_latency DESC,
           sign_jitter DESC,
           verifierid ASC
  </code></pre>
  
  <blockquote>
    <p>Error "ORA-01830": date format picture ends before converting entire
    input string (Oracle Error)</p>
  </blockquote>