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  | 
                             
                            
                                    | 
                                         swthomas 
                                        Starting Member 
                                         
                                        
                                        2 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2008-08-11 : 14:29:19
                                            
  | 
                                             
                                            
                                            | I have a table of Application IDs (AID), each AID may have one to many Projects, each project has a start and end date in separate columns.  How do I report on the AID earliest start date and the latest end date based on the project start and end dates for the AID?  The table has multiple AIDs in it and is sorted/keyed on the AID. | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     jsmith8858 
                                    Dr. Cross Join 
                                     
                                    
                                    7423 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-08-11 : 14:49:31
                                          
  | 
                                         
                                        
                                          | select aid, min(startdate) as MinStartDate, max(endDate) as MaxEndDatefrom yourtablegroup by aid- Jeffhttp://weblogs.sqlteam.com/JeffS  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     swthomas 
                                    Starting Member 
                                     
                                    
                                    2 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-08-11 : 15:37:29
                                          
  | 
                                         
                                        
                                          | Thanks!  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |