title: Is there a quick way to separate date and time from a time stamp in sql?
body: <p>I am using sql to calculate the average daily temperature and max daily temperature based on a date timestamp in an existing database. Is there a quick way to accomplish this?</p>
  
  <p>I am using dBeaver to do all my data calculations and the following code is what I have used so far:</p>
  
  <pre><code>SELECT
      convert(varchar, OBS_TIME_LOCAL , 100) AS datepart,
      convert(varchar, OBS_TIME_LOCAL, 108) AS timepart,
      CAST (datepart AS date) date_local,
      CAST (timepart AS time) time_local
  FROM
      APP_RSERVERLOAD.ONC_TMS_CUR_ONCOR_WEATHER;
  </code></pre>
  
  <p>The data format as follows:</p>
  
  <pre><code>ID              time_stamp              temp
  --------------------------------------------
  de2145        2018-07-16 16:55           103
  </code></pre>
  
  <p>There are multiple IDs with 24hrs of temperature data at 1 min increments. </p>