title: Different Column for Distinct value in SQL
body: <p>I've written this SQL query:</p>
  
  <pre><code>SELECT TOP (15) UserName, EventName, EventTime
  FROM AttendanceEvents
  WHERE UserName = 'Kareem'
  </code></pre>
  
  <p>Which results in :</p>
  
  <p><a href="https://i.stack.imgur.com/FmFcE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FmFcE.png" alt="enter image description here"></a></p>
  
  <p>How can I separate values into new columns for an Event?</p>
  
  <p>The output I want is:</p>
  
  <pre><code>UserName | Login                | LogOut
  Kareem    2015-04-13 01:43       2015-04-13 13:44
  Kareem    2015-04-18 12:39       NULL
  Kareem    2015-04-18 12:43       NULL
  .
  .
  .
  Kareem    2015-04-25 00:35       2015-04-25 05:21
  </code></pre>