You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL Server Query: DateTime addition/subtraction translation to server #11039
Addition/subtraction of DateTime gives type of TimeSpan. At present postgre can do it correctly because it has mapping type - interval.
This issue is to track,
Translation of addition/subtraction for DateTime to server and materializing it back to TimeSpan on client side doing some computation.
Translation of member access on +/- of DateTime (e.g. (DateTime - DateTime).TotalDays) to server. For SQLite it may be possible to do using julianday function subtraction which gives difference of days in REAL type. Reading a TimeSpan will coerce the REAL value.
Reacted by NetMage, Steven Darby, Anton Egorov, fretje and Xriuk
changed the title [-]Query: DateTime addition/subtraction translation to server[/-][+]SQL Server Query: DateTime addition/subtraction translation to server[/+]on Apr 25, 2018
Activity
bricelam commentedon Apr 25, 2018
We can't translate this on SQLite (without registering a UDF). If we rely on coercion, queries like this would fail:
[-]Query: DateTime addition/subtraction translation to server[/-][+]SQL Server Query: DateTime addition/subtraction translation to server[/+]NetMage commentedon May 13, 2020
@bricelam Why won't the SQLite
dateandstrftimefunctions work to translate the query?bricelam commentedon May 13, 2020
@NetMage They work just fine. (see PR #19617)
My comment was more that if we did this by default for all relational providers, the results would be wrong for SQLite.