Table .GroupBy(x=>x.Name) .Select(x=>new {Name=x.Key, Entrytime=x.Min(m=>m.Entrytime), Exittime=x.Max(m=>m.Exittime)})
Here's a LinqPad query showing how to do it on an IEnumerable when Entrytime and Exittime are strings instead of a datetime:
var list= new[]{ new {Name="A",Entrytime="10:30 AM",Exittime="6:30PM"}, new {Name="A",Entrytime="7:30 AM",Exittime="5:30PM"}, new {Name="B",Entrytime="10:30 AM",Exittime="2:30PM"}, new {Name="A",Entrytime="5:30 AM",Exittime="3:30PM"}, new {Name="B",Entrytime="11:30 AM",Exittime="4:30PM"}, new {Name="A",Entrytime="8:30 AM",Exittime="7:30PM"}, new {Name="C",Entrytime="9:30 AM",Exittime="1:30PM"}, new {Name="C",Entrytime="10:30 AM",Exittime="9:30PM"}}; var result=list.GroupBy(x=>x.Name) .Select(x=>new {Name=x.Key, Entrytime=x.Min(m=>DateTime.Parse(m.Entrytime)).ToString("h:mm tt"), Exittime=x.Max(m=>DateTime.Parse(m.Exittime)).ToString("h:mm tt")}); result.Dump();