title: Allow Nulls into a List<DateTime> but exclude nulls in Min.Date()
body: <p>I'm trying to populate a List&lt;> with dates but allow Nulls because the data source can contain nulls for the date. This is the code I tried this:</p>
  
  <pre><code>List&lt;Nullable&lt;DateTime&gt;&gt; DateList = new List&lt;Nullable&lt;DateTime&gt;&gt;();
  
  
      for (int ii = 0; ii &lt; queryresults.Count; ii++)
      {
  
          object o = queryresults[ii].Fields[SplitComboBox.SelectedItem.ToString()].Value;
  
          if (o is DateTime)
          {
              DateList.Add((DateTime)o);
          }
          else
          {
              DateList.Add(null);
          }
      }
  }        
  
  var firstDay = DateList.Min().Date;
  var results =
      DateList
        .GroupBy(x =&gt; x.Date.Subtract(firstDay).Days / 7 + 1)
        .SelectMany(gx =&gt; gx, (gx, x) =&gt; new {Week = gx.Key,DateTime = x,Count = gx.Count(),});
  </code></pre>
  
  <p>But now the .Min().Date doesn't work.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>My main goal is to be able to pull all the datetime values from a column from a collection. Find the Min().Date and Group the datetimes based on the Min().Date by week starting from the Min().Date</p>
  
  <p>This is what I came up with basically, iterate through the collection, put all the datetimes into a datelist, find the min and groupthem to find the week. I need the null values as placeholders because what I'll eventually do is output each value back to the collection, so I know what week that datetime was in, in relation the min.date</p>