You are not logged in.
Pages: 1
There doesn't seem an easy way to do an SQL select on a date range with TDateTime fields as it's stored as a string. What is the best field type to use in a table where I want to do date range searches?
Offline
Thanks for the quick response. Would it make sense to have TDateTime stored as a floating point like in Delphi and have a separate type for ISO 8601 dates?
Offline
Just read the docs: 3.1.4. Floating point and Currency fields, and think I see why it doesn't make sense
Offline
ISO 8601 is pretty standard in database, and it is the default SQLite3 format.
You have dedicated functions in SQLite SQL: see http://www.sqlite.org/lang_datefunc.html
Problem is that SQLite does not allow to create an index from a function result (AFAIK) so the engine has to lookup the whole table to perform a date query.
Delphi TDateTime is the COM date/time format, but even .NET does not use it.
Our Int64=TTimeLog format is not standard either, but easy to work with, and very efficient for speed (it uses bit maps, and no multiplication/division).
Offline
Pages: 1