I am trying to return a view which will display the logs from current day.
This sql query does exactly what i need.
select * from Logs where Date>=GETDATE()-1
but I am having trouble with the razor syntax to write this statement in my view.
return View(db.Logs.Where(a => a.Date >= DateTime.Today() - 1));
Any idea how to display logs in the view for the current date?
Anonymous User
09-Oct-2014return View(db.Logs.Where(a => a.Date == DateTime.Today));