for (int id = 0; id < 200; id++) { var foundID = from r in dv.AsEnumerable() orderby r.Field("Log Date") where r.Field("User ID") == id select r; foreach (var row in foundID) { var foundDate = overtime.Select("ID = '" + id + "' AND 'Log Date' = '"+row.Field("Log Date")+"'"); if(foundDate.Count() == 0){ Rowq["ID"] = row.Field("User ID"); Rowq["Date"] = row.Field("Log Date"); overtime.Rows.Add(Rowq); Rowq = overtime.NewRow(); id++; } else { continue; } } 0000000002 Name1 2014/10/16 09:03:13 F1 0000000002 Name1 2014/10/16 17:02:20 F2 0000000002 Name1 2014/10/18 08:38:42 F1 0000000002 Name1 2014/10/18 16:55:02 F2 0000000002 Name1 2014/10/19 09:05:21 F1 0000000004 Name2 2014/10/01 00:07:09 F2 0000000004 Name2 2014/10/01 15:46:49 F1 0000000004 Name2 2014/10/02 00:09:52 F2 ID Name Date F1 F2 0000000002 Name1 2014/10/16 09:03:13 17:02:20 0000000002 Name1 2014/10/18 08:38:42 16:55:02 etc..