Combination of grouping by several fields and select latest date?
<p>I have a table of responses to a survey (assessments) an area can submit several assessments but I only want the responses for the latest assessment per area.</p>

<p>Below is my data, the records marked with * would be the ones I would like return</p>

<pre><code>AsessmentID AssessmentDate Status  AreaID Response Category
          1    01/01/2016  Complete    1       1    A
          1    01/01/2016  Complete    1       2    B
          1    01/01/2016  Complete    1       4    C
          2    05/01/2016  Complete    1       5*   A
          2    05/01/2016  Complete    1       4*   B
          2    05/01/2016  Complete    1       5*   C
          3    02/01/2016  Complete    2       1*   A
          3    02/01/2016  Complete    2       2*   B
          3    02/01/2016  Complete    2       4*   C
          4    03/01/2016  Complete    3       5*   A
          4    03/01/2016  Complete    3       4*   B
          4    03/01/2016  Complete    3       5*   C
          5    04/01/2016  Draft       3       3    A
          5    04/01/2016  Draft       3       2    B
          5    04/01/2016  Draft       3       3    C
</code></pre>

<p>Here is my linq so far but it only returns 2 responses</p>

<pre><code>from c in db.Answers.Where(b =&gt; b.Status == Status.Complete)
                                  group c by new { c.AreaID, c.AssessmentID, c.AssessmentDate} into grp
                                  select grp.OrderByDescending(c =&gt; c.AssessmentDate).FirstOrDefault();
</code></pre>