title: How to sort or order date in dynamic Pivot Sql Server 2008
body: <blockquote>
    <p>I have the following table</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/cM9gO.jpg" alt="enter image description here"></p>
  
  <p>The table after pivoting is as follows. How do I maintain the date order in pivoted columns?</p>
  
  <p><img src="https://i.stack.imgur.com/JdvY0.jpg" alt="enter image description here"></p>