title: how to convert a timestamp to int in sql (vertica)
body: <p>I have a timestamp as <code>2017-07-19 11:45:01</code>and i want it to convert to int.</p>
  
  <p>Query:</p>
  
  <pre><code>select cast(max(event_timestamp) as INT) from error_messages where error_level='ERROR' and user_name='git'
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>SQL Error [2366] [42846]: [Vertica][VJDBC](2366) ERROR: Cannot cast type timestamptz to int
    [Vertica][VJDBC](2366) ERROR: Cannot cast type timestamptz to int
      com.vertica.util.ServerException: [Vertica][VJDBC](2366) ERROR: Cannot cast type timestamptz to int
  </code></pre>