forum

Home / DeveloperSection / Forums / DateTime.Today in mvc

DateTime.Today in mvc

Anonymous User 2063 09-Oct-2014

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?


Updated on 09-Oct-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By