title: SSRS/SQL Grouping the data as in PB report
body: <p>We are migrating the PB to SSRS report, in one report , they want to show the report as below format. basically sorting by dates column while retrieving, then apply group by customer name and it looks like below. </p>
  
  <p>I am trying to achieve the same in SSRS through SSRS or using SQL. </p>
  
  <pre><code>        Vicky 
               2000-01-01 00:00:00.000    400
  
          SMART
               2001-01-01 00:00:00.000    600
               2001-01-01 00:00:00.000    900
  
          Rocky   
               2001-01-02 00:00:00.000
  
          Vicky   
              2002-01-01 00:00:00.000 200
  
          Rocky   
              2003-01-01 00:00:00.000 300
              2005-01-01 00:00:00.000 700
              2006-01-01 00:00:00.000 800
  
          SMART   
              2010-01-01 00:00:00.000 900
  
  
          Sample script. 
  
          Create table #Sample (CustomerName varchar(10),InvDate datetime, Invamount INT)
  
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('Rocky','1/2/2001',100)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('Vicky','1/1/2002',200)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('Rocky','1/1/2003',300)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('Vicky','1/1/2000',400)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('SMART','1/1/2001',600)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('Rocky','1/1/2005',700)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('Rocky','1/1/2006',800)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('SMART','1/1/2001',900)
          Insert into #Sample (CustomerName,InvDate,Invamount) Values ('SMART','1/1/2010',900)
  
          SELECT * from #Sample
          ORDER BY InvDate    
  </code></pre>