You are facing an error in linq-to-sql or EF (I don't know which one you are using). A direct solution would be to use a property DateTime.Date, however this is not supported in both ORMs, it does not map to the SQL method.
You have two solutions:
Simple query assessment with ToList:
var q = ctx.Table.ToList().Select(r => r.datetimefield.Date).Distinct();
Create a field that only details the date component in the database. So I usually go because you can stay in the database and execute the query there.
source
share