title: How to compare Datetime variables with lambda expressions?
body: <p>Having a date reference UserJoinDate and the list of dates List friendsJoined I would like to count how many friends joined a service before UserJoinDate and how many as the same time or later.</p>
  
  <p>I wrote the following lines but it doesn't work:</p>
  
  <pre><code>List&lt;DateTime&gt; joinersDates = getJoinersDates();
  FriendsJoinedBeforeCount = joinersDates .Where(x =&gt; x &lt; UserJoinDate).Count();
  FriendsJoinedAfterCount = joinersDates .Where(x =&gt; x &gt;= UserJoinDate).Count();
  </code></pre>
  
  <p>Does anyone know how to count how many dates from the list joinersDates are before UserJoinDate and how many the same or after?</p>
  
  <h1>Edit</h1>
  
  <p>Here is the Copy from ImmediateWindow:</p>
  
  <pre><code>churnersDates.Count( x =&gt; x &gt; UserChurnDate)
  Expression cannot contain lambda expressions
  </code></pre>
  
  <p>UserJoinDate Is DateTime</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>UserJoinDate = 9.11.2010 0:30:00
  </code></pre>
  
  <p>(the value is copied from Date: {9.11.2010 0:00:00}
      Day: 9
      DayOfWeek: Tuesday
      DayOfYear: 313...)</p>
  
  <p>and</p>
  
  <pre><code>joinersDates.First() = 17.5.2011 0:30:00
  </code></pre>
  
  <p>Thanks!</p>