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  | 
                             
                            
                                    | 
                                         echofive 
                                        Starting Member 
                                         
                                        
                                        1 Post  | 
                                        
                                        
                                            
                                            
                                             Posted - 2008-07-06 : 03:44:44
                                            
  | 
                                             
                                            
                                            | Hi,I'm trying to write a SQL statement that will add up the numbers in a column and group them by an ID, then add information from another table(s) based on the same ID.so what I've come up with that I can get to work, works by createing views...create view Totalsales AsSelect SUM(orders.total) as Totals, orders.employeeidfrom ordersgroup by orders.employeeid;select totalsales.totals, employees.firstname, employees.lastnamefrom totalsales, employeeswhere employees.employeeid=totalsales.employeeidwhich works well, except I need to perform this statement from our a peice of sofrware that unfortunately does not let you create views....The DB is an access DB. I can't figure out another way to get the results I want... if any more info is required please let me know.Thank you in advanceKyle  | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     AndrewMurphy 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    2916 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-07-07 : 03:15:23
                                          
  | 
                                         
                                        
                                          | Sample input data and sample MATCHING expected results would help.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |