title: adding time from one timestamp field to other field
body: <p>I'm trying to add the time (hours minutes and seconds) from the user initial date to the current date but I received an errors.</p>
  
  <p>I don't know what I do wrong, open to other suggestions</p>
  
  <pre><code>select distinct uid,
         min (ts) over (partition by uid order by ts rows unbounded preceding) as initial_date,
         current_date-2 + interval 'to_char(min (ts) over (partition by uid order by ts rows unbounded preceding),'HH') hours'
    from mr_session_log
  where ts &gt;= '2015-09-01'
  </code></pre>
  
  <p>and this the error I've recevied</p>
  
  <pre><code>ERROR: syntax error at or near "') hours'"
  </code></pre>
  
  <p>Position: 355</p>
  
  <pre><code>current_date-2 + interval 'to_char(min (ts) over (partition by uid order by ts rows unbounded preceding),'HH') hours',
                                                                                                                 ^
  </code></pre>