title: Query to get the data between two dates with only specific time duraion
body: <p>I want to pull data from DB2 from 01-June-2016 to 30-June-2016 from 5 PM to 6 PM only. Can anyone please help me how to achieve this?</p>
  
  <p><code>CRTN_TS</code> type is <code>Timetamp</code> format of DB2. </p>
  
  <p>I tried using below query, but gives all values between 20160601220000000000 and 20160601230000000000.</p>
  
  <pre><code>SELECT * FROM customer 
  WHERE CRTN_TS &gt;= TIMESTAMP_FORMAT('20160601220000000000','YYYYMMDDHH24MISSFF6') 
    AND CRTN_TS &lt;= TIMESTAMP_FORMAT('20160601230000000000','YYYYMMDDHH24MISSFF6')
  </code></pre>