Use of String.compare for a varchar field in SAP


Try to use SqlFunctions.DateDiff method overload which requires 3 inputs as follows −

var res = from a in db.Set<table1>()
where SqlFunctions.DateDiff("dd", a.Date, "20161922") >= 0
&& SqlFunctions.DateDiff("dd", a.Date, "20161122") < 0
select a

Updated on: 13-Feb-2020

60 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements