Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        
            
                
                    
                        
                            
                                | Author | 
                                
                                 Topic  | 
                             
                            
                                    | 
                                         usafelix 
                                        Posting Yak  Master 
                                         
                                        
                                        165 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2014-08-13 : 00:14:02
                                            
  | 
                                             
                                            
                                            | Urgent help ! I want to write a query to change the last record is show to grand total. how I can use the shop code is null and display the "Total" andnot display zero in GP% ?this 10631.7 is used by rollup to display. Sales date      shop    GP%             amount 20140813	KC001	4.000000	102.0020140813	LM001	54.000000	1697.5020140813	MC001	55.000000	684.0020140813	MK002	49.000000	1413.3020140813	NP002	70.000000	395.3020140813	TM002	47.000000	1983.3020140813	TM003	64.000000	698.9020140813	TS001	44.000000	225.9020140813	TW003	26.000000	21.8020140813	WC002	53.000000	1962.8020140813	YL002	56.000000	1446.9020140813	null	53.000000	10631.70 | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     robbie2883 
                                    Starting Member 
                                     
                                    
                                    2 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2014-08-16 : 00:24:14
                                          
  | 
                                         
                                        
                                          | you could pull your results and then union the select and sum the columns  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |