title: Dynamically generate columns in SQL Server
body: <p>I have following piece of SQL. I use this to return the daily reception times of an account group. </p>
  
  <pre><code>SELECT 
      ACCT_GRP_ID,
      CONCAT(CONCAT(FORMAT(GETDATE(),'dd-MM-yyyy'), ' '),    
      AS_RECEPTION_TIMES.RECEPTION_WINDOW_START) AS RECEPTION_START,
      CONCAT(CONCAT(FORMAT(GETDATE(),'dd-MMyyyy'), ' '), 
      AS_RECEPTION_TIMES.RECEPTION_WINDOW_END) AS RECEPTION_END
  FROM 
      AS_RECEPTION_TIMES
  JOIN 
      AS_AS_RECEPTION_CONF ON AS_RECEPTION_TIMES.ACCT_STAT_RECEPTION_CONFIG_ID = AS_AS_RECEPTION_CONF.ID
  WHERE 
      ACCT_GRP_ID &gt; 1
  </code></pre>
  
  <p>This returns the following result:</p>
  
  <p><a href="https://i.stack.imgur.com/ZUTtG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZUTtG.png" alt="enter image description here"></a></p>
  
  <p>As you can see I have different account groups with multiple reception timings.
  Now I want to group accounts so I only have 1 line for each <code>ACCT_GRP_ID</code> with all the reception start and endings in columns behind it. </p>
  
  <p>How can I realize this?</p>