Timediff not working
(1) By anonymous on 2023-10-21 20:13:52 [link] [source]
Using SQLiteSudio 3.4.4, I was making some tests on date and datetime values, to better understand how SQLite deals with distinct date or datetime representations.
At one point I tried to use timediff() and it didn't work, I always got the same error: "[20:26:25] Error while executing SQL query on database 'wsvDebug': no such function: timediff"
Even an example taken from the documentation ends up with the same error: "SELECT timediff('2023-02-15','2023-03-15');"
Isn't timediff() a built-in function ?
Thanks
(2) By Richard Hipp (drh) on 2023-10-21 20:40:36 in reply to 1 [link] [source]
The timediff() SQL function was added to SQLite with release 3.43.0 on 2023-08-24 (1 month and 27 days ago, according to timediff()). How old is SQLiteStudio 3.4.4?
(3) By Larry Brasfield (larrybr) on 2023-10-21 20:42:41 in reply to 1 [link] [source]
The timediff() function is built-in, but it is a recent addition, added in May of 2023 for the 3.43.0 release of SQLite on August 24.
(4) By anonymous on 2023-10-21 21:45:04 in reply to 1 [source]
OK, I see the problem.
On the SQLiteStudio side, version 3.4.4 was released on April 6. On the application side I'm considering using version 7.0.12 of Microsoft.EntityFrameworkCore.Sqlite in .Net, released on October 10. Didn't check yet, but I believe it might not be synchronized with the latest SQLite version, but in any case I doubt it would include calls to timediff in generated SQL code.
It's not a serious issue, though. I can explore other means, at the moment I'm just trying to define the list of features to use or to avoid.
Thanks for the explanation