I want to get date part only from database 'date time' value I m using the below code..but it is getting date and time part.
using (FEntities context = new FEntities())
{
DateTime date = DateTime.Now;
if (context.tblvalue.Any(x => x.date == date))
{
}
}
accepts pure SQL in the first parameter. Use MS SQL server's function CONVERT(VARCHAR(6), date_value, 112) AS MonthYYYYmm for retrieving year with month.
With entity framework 6 and update use
You can compare just specified parts:
EDIT: You can also try the following:
Another approach: