title: Between 2 date/times in PL/SQL not giving expected answers
body: <p>I have a query in PL/SQL on Oracle 10g that isn't behaving as I thought.  I'm 100% sure I am doing something silly so I'm sorry.. Here goes:</p>
  
  <p>I have some data in a table that looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/EncbX.jpg" alt="enter image description here"></p>
  
  <p>I then went to query but using the time element, like this:</p>
  
  <pre><code>select * from dw_time
  where createdtime &gt; to_date('2012/04/12 03:06:00', 'yyyy/mm/dd hh24:mi:ss')
  </code></pre>
  
  <p>When this is executed we get records returned that include the rows in the image 03:05AM.  So thinking it was the to_date function I checked that:</p>
  
  <pre><code>select  to_date('2012/04/12 10:24:00', 'yyyy/mm/dd hh:mi:ss')
  from dual;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/xY5lX.jpg" alt="results"></p>
  
  <p>Now I was totally confused as it clearly know that as a time.  So I tried it again:</p>
  
  <pre><code>select * from dw_time
  where createdtime &gt; to_date('2012/04/12 03:06:00', 'yyyy/mm/dd hh24:mi:ss')
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/APTy7.jpg" alt="enter image description here"></p>
  
  <p>As you can see it is totally ignoring the time component! At this point I thought it was time to ask the gurus on here!</p>
  
  <p>Many thanks</p>
  
  <p>Mike</p>