LINQ to Entities for subtracting 2 dates

The accepted answer is better in this case, but for reference you can use the EntityFunctions class to perform operations on dates, among other things.

where (vid.CreatedDate >= EntityFunctions.AddDays(DateTime.Now, -maxAgeInDay))

Leave a Comment