Open moander opened 11 months ago
What problem are you trying to solve?
Microsoft.Data.SqlClient.SqlException (0x80131904): The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.
db.Bars.Where(x => EF.Functions.DateDiffMinute(x.PeriodStart, x.PeriodEnd) > validForMinutes )
I can't use a less precise datepart so the solution is to use DATEDIFF_BIG.
DATEDIFF_BIG
db.Bars.Where(x => EF.Functions.DateDiffMinuteLong(x.PeriodStart, x.PeriodEnd) > validForMinutes )
Am I missing something?
We could introduce DateDiffBig* overloads for this case. Note conversation in https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1875#issuecomment-1987951733.
What problem are you trying to solve?
I can't use a less precise datepart so the solution is to use
DATEDIFF_BIG
.Am I missing something?