String Date = "17/3/2015"; DateTime StartDate = Convert.ToDateTime(Date); DateTime EndDate = StartDate.AddDays(7); Console.WriteLine("Report Generated From {0} to {1}",StartDate,EndDate); var Connection = from C in Sessions where (C.StartDate >= StartDate && C.StartDate < EndDate && C.User != null) select new {C.User.UserName,DG = C.Machine.DesktopGroup.Name}; //Console.WriteLine(Connection.ToList().GroupBy(u=>u.DG)); List UD = new List(); foreach(var user in Connection.ToList().GroupBy(u=>u.DG).ToList() ) { UD.Add(new UserAndDG(user.ToList()[0].DG,user.ToList().Count)); } Console.WriteLine(UD.ToList()); } public class UserAndDG { public string DeliveryGroup; public int UserCount; public UserAndDG(String DeliveryGroup,int UserCount){ this.DeliveryGroup = DeliveryGroup; this.UserCount = UserCount; }