If the scenario is something like a different date/time between the server and the client, then the following suggestion won't work. Or, if you're a purist (read: hardheaded
) like I am and insist on using getdate(), then it won't work either. If neither applies to you, then you could simply construct your predicate in a different way. Rather than the desired output of..
getdate() - dateField > 2, the following does the same thing
dateField < 'current date here' - 2
which can be done like so...
<YourNamespace>.HelperClasses.ThisEntitysFields.DateField < DateTime.Now-new TimeSpan(2,0,0,0)