Reputation: 151
.Where(x => x.POD_DATE == xDATEx)
I need to check if xDATEx
is the same date as x.POD_DATE
but xDATEx
gives me results like 2011-07-17 00:00:00.000
and the x.POD_DATE
gives 2011-07-17 01:15:43.577
How do I compare them, despite the results not being in a date only format?
Upvotes: 1
Views: 1302
Reputation: 151
var xDate2 = xDATEx.AddDays(1);
var q = new OrderDataRepository()
.GetAllOrderData()
.Where(x => x.POD_DATE >= xDATEx && x.POD_DATE < xDate2)
Upvotes: 0
Reputation: 46008
http://msdn.microsoft.com/en-us/library/dd395596.aspx
using System.Data.Objects;
.Where(x => EntityFunctions.TruncateTime(x.POD_DATE) == EntityFunctions.TruncateTime(xDATEx))
Upvotes: 2