Problem
I want to compare "dd-mm-yyyy" DateTime's without factoring in the time.
Attempt
I have tried comparing the standard DateTime values with my database DateTime's like this:
C#/LINQ:
var startDate = DateTime.Today.AddDays(-10);
var endDate = DateTime.Today;
dateList= (from x in db.MY_DB
where (x.DATE >= startDate && x.DATE < endDate)
select x).ToList();
However, my list never gets populated, even though many entries meet this criteria, which I verified with the following query in SQL:
SQL Query:
Select * from db.my_db where date between '13-JUN-2016' and '23-JUN-2016';
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…