Kwasi Denkyira

Kwasi Denkyira

  • 1.8k
  • 98
  • 4.2k

How to get all null items greater than 4 months from current

Aug 1 2019 2:38 PM
I am trying to get all null items for a table column greater than 4 months from today's date using Linq. Below is my query. Although there are items, my query returns 0. I am not sure what I am doing wrong.
 
var FinalizedDate = DateTime.Now.AddMonths(- 4);
var test = EmpTable.Include(x => x.admintable.registers.Select(wt => wt.adminSurnames))
.Where(x => x.admintable.Id == 45
&& x.FinalizedDateTime == null && x.FinalizedDateTime > FinalizedDate).ToList();

Answers (4)