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-12 : 23:20:51
                                            
  | 
                                             
                                            
                                            | Urgent Help I want write a query to get this below result. trimming zero, average GP and adding grand total. ThanksCurrent result is shop   sales amount   GP A      100.00000     10.08B      200.00000     20.06C      300.0000      30.14 Expect result is :-shop    saleamount     GPA       HK$ 1000       50%B       HK$ 200        10%C       HK$ 300        15% Total   HK$ 1500       (average GP% xxx) | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     Bustaz Kool 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    1834 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2014-08-13 : 11:59:16
                                          
  | 
                                         
                                        
                                          How are you generating the GP Percentage value? Too often we enjoy the comfort of opinion without the discomfort of thought. - John F. Kennedy  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     usafelix 
                                    Posting Yak  Master 
                                     
                                    
                                    165 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2014-08-15 : 05:28:29
                                          
  | 
                                         
                                        
                                          | The GP is base on sum up all shop the GP% and divided to no of shop.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     Bustaz Kool 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    1834 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2014-08-20 : 16:13:57
                                          
  | 
                                         
                                        
                                          How does 100 have a GP of 50%? Too often we enjoy the comfort of opinion without the discomfort of thought. - John F. Kennedy  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |