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  | 
                             
                            
                                    | 
                                         prakashuj 
                                        Starting Member 
                                         
                                        
                                        12 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2014-04-09 : 04:10:25
                                            
  | 
                                             
                                            
                                            | Dear All,The have the data in the below formatName	Dept	Punch Date	StatusRobin	Purchase	4/3/14 18:00	OutRobin	Purchase	4/3/14 17:57	InRobin	Purchase	4/3/14 15:04	OutRobin	Purchase	4/3/14 14:20	InAlex	Accounts	4/3/14 14:09	OutAlex	Accounts	4/3/14 14:07	InAlex	Accounts	4/3/14 10:53	OutAlex	Accounts	4/3/14 7:52	InI need the query which gives the output in the below FormatName	Dept	Punch Date	StatusRobin	Purchase	4/3/14 18:00	Out		4/3/14 17:57	In		4/3/14 15:04	Out		4/3/14 14:20	InAlex	Accounts	4/3/14 14:09	Out		4/3/14 14:07	In		4/3/14 10:53	Out		4/3/14 7:52	InThanks and RegardsPrakash | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     madhivanan 
                                    Premature Yak Congratulator 
                                     
                                    
                                    22864 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2014-04-10 : 04:19:26
                                          
  | 
                                         
                                        
                                          | This is the formation issue which should be done in a front end application.MadhivananFailing to plan is Planning to fail  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |