title: SQL Pivot with multiple columns
body: <p>Need help with the pivot clause in sql server 2008.
  I have a table with this info:</p>
  
  <p><PRE>
  Weekno    DayOfWeek     FromTime    ToTime
  1         2             10:00       14:00
  1         3             10:00       14:00
  2         3             08:00       13:00
  2         4             09:00       13:00
  2         5             14:00       22:00
  3         1             06:00       13:00
  3         4             06:00       13:00
  3         5             14:00       22:00
  </PRE></p>
  
  <p>I want to convert this into a table that looks like this:
  <PRE>
  Week    Start1    End1    Start2    End2    Start3    End3    Start4    End4    Start5    End5    Start6    End6    Start7    End7
  1                         10:00     14:00   10:00     14:00
  2                                           08:00     13:00   09:00     13:00   14:00     22:00
  3       06:00     13:00                                       06:00     13:00   14:00     22:00
  </Pre></p>
  
  <p>Is there any way to do with a pivot query?
  Please write respond with an example on how to do it. </p>
  
  <p>I appreciate any kind of help on this. Thanks in advance. </p>