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.
I wrote the following lines but it doesn’t work:
List<DateTime> joinersDates = getJoinersDates();
FriendsJoinedBeforeCount = joinersDates .Where(x => x < UserJoinDate).Count();
FriendsJoinedAfterCount = joinersDates .Where(x => x >= UserJoinDate).Count();
Does anyone know how to count how many dates from the list joinersDates are before UserJoinDate and how many the same or after?
Edit
Here is the Copy from ImmediateWindow:
churnersDates.Count( x => x > UserChurnDate)
Expression cannot contain lambda expressions
UserJoinDate Is DateTime
Example:
UserJoinDate = 9.11.2010 0:30:00
(the value is copied from Date: {9.11.2010 0:00:00}
Day: 9
DayOfWeek: Tuesday
DayOfYear: 313…)
and
joinersDates.First() = 17.5.2011 0:30:00
Thanks!
Try the following code:
Or try to use Ticks property: