var query = _context.POS_ItemPriceListMaster.Where(c => c.FromDate >= FromDate && c.ToDate <= FromDate).Select(t=> t.ItemPriceListMasterID);
var query2 = from c in _context.POS_ItemPriceList
where query.Contains(c.ItemPriceListMasterID)
select c;
I want to do this but there are no result in query although there are data with from date
In database field is datetime
I assume
c.FromDateandc.ToDateare dates without time information andFromDateis a date with time information.To fix your query, remove the time from
FromDate: