Reproduced:
DateTime toCompareWith = new DateTime(2004, 4, 28);
var q = from o in metaData.Order
where o.OrderDate == toCompareWith.Date
&& o.OrderDate < toCompareWith.AddDays(1)
select o;
Interestingly enough, this works:
var q = from o in metaData.Order
where o.OrderDate.Value.Date == new DateTime(2004, 4, 28)
select o;
Will check it out.
(edit). More interestingly, this ALSO works:
var q = from o in metaData.Order
where o.OrderDate.Value == toCompareWith.Date
&& o.OrderDate.Value < toCompareWith.AddDays(1)
select o;
So the nullable field should be used with 'Value' to work around this. The 'Date' property in your query isn't executed on the db, it's an in-memory constant, as the property is called in an in-memory object.
I'll still try to fix this though.
(edit) the cause is that the constant is wrapped twice in a Convert() expression by the C# compiler: first to cast the DateTime to a Nullable<DateTime> and then again to a DateTime... The Convert stripper routine just unwrapped 1, but should unwrap all.
(edit).
Fixed it in next build.