title: How to cast time from date and time
body: <p>I am trying to extract only the time for the date time format that I currently have. So far this is the query that I have. I would like to only extract the time for the columns that I am creating (First_Arrival, Last_Arrival, etc.)</p>
  
  <pre><code>SELECT logon_id,activity_date
  ,MIN(CASE WHEN activity = 'AsnAssignmentOnSite_evt' THEN occurred END) First_Arrival
  ,MAX(CASE WHEN activity = 'AsnAssignmentOnSite_evt' THEN occurred END) Last_Arrival
  ,MIN(CASE WHEN activity = 'OrdActivityComplete_evt' THEN occurred END) First_Completion
  ,MAX(CASE WHEN activity = 'OrdActivityComplete_evt' THEN occurred END) Last_Completion
  ,MIN(CASE WHEN activity = 'AsnAssignmentEnRoute_evt' THEN occurred END) First_Enroute
  ,MAX(CASE WHEN activity = 'AsnAssignmentEnRoute_evt' THEN occurred END) Last_Enroute
  FROM activity
  GROUP BY logon_id,activity_date
  order by ACTIVITY_DATE
  </code></pre>