title: Simple way to compare Dates in DateTime attribute using Entity Framework 4 and Linq queries
body: <p>I'm trying to run the following bit of code, but the comparison fails by not handing my the entities I expect it to. </p>
  
  <p>It's comparing <code>06/09/2011 0:00:00</code> to <code>06/09/2011 12:25:00</code>, the latter being my databases record value. So that's why the comparison is failing and I'm not getting the records I need.</p>
  
  <p>I'm just trying to compare if the dates match up, I'm don't care about the time.</p>
  
  <pre><code>DateTime today = DateTime.Now.Date;
  var newAuctionsResults = repo.FindAllAuctions()
                          .Where(a =&gt; a.IsActive == true || a.StartTime.Value == today)
                          .ToList();
  </code></pre>
  
  <p>How can I compare only the dates?</p>
  
  <p>If use the .Date property in the .StartTime.Value part, I get an exception:</p>
  
  <blockquote>
    <p>The specified type member 'Date' is not supported in LINQ to Entities.
    Only initializers, entity members, and entity navigation properties
    are supported.</p>
  </blockquote>