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  | 
                             
                            
                                    | 
                                         sz1 
                                        Aged Yak Warrior 
                                         
                                        
                                        555 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2013-03-06 : 06:56:04
                                            
  | 
                                             
                                            
                                            | HiI have a table with changing colours that tell me what stage a ticket is at, for example RED = today, GREEN = tomorrow and BLUE = before today.The date returned is good which I've grouped together the colours based on sort: Agreed_Solved_Date_Time, Status, I want the Status field to always Z-A so they are grouped together but I also still want to keep the colours together, obviously if I remove the Agreed_Solved_Date_Time from the sort we get the Status at the top but the colour grouping is then thrown all over.There is a colour function populating the actual colours which is:Public Function fnGetConditionalColor(pDate as datetime) AS String	Dim d AS integer	Dim c as string	d= DateDiff("d", pDate.Date, Now.Date)	IF d<0 THEN 	c="Green"	ELSE IF d =0 and d <=1 THEN 		c="Red"	ELSE 		c="Blue"	END IF	Return cEnd FunctionCan this be achieved using this method, how can I first call the function to use in the report for the first sort followed by the Status field.Screenshot of current report.http://www.pcfixerman.com/index.php/screenshotAs you can see I want the WIP at the top of the colours but still maintaining the colours together?Thanks in advance.SZ1Learning and development is the driving force in the universe...! | 
                                             
                                         
                                     | 
                             
       
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |