User1520731567 posted
Hi slimbunny,
I find you use Cast(xxx as DATE),
If your format of CreatedDate is so special that be different with DateTime.Today,they can't compare with each other and will affect your results.
So,combining with what @PatriceSc said and use toString() method to convert a format which you want.
For example:
var today = DateTime.Today.ToString("yyyy-M-d");//2019-7-2
var aa = db.tablename.Where(x => x.RecordID == 200 && x.EmployeeID ==3 && x.CreatedDate == today).ToList();
More details about date/time format string,you could refer to:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
Best Regards.
Yuki Tao