Using: Delphi XE2, Unidac 4.5.10 Pro
URGENT!
I need you to tell me how to store and retrieve Time values in SQLite database.
The field is defined as REAL in the database.
Now when retrieving the value, how to convert this real value to TTime type properly?
How to store/retrieve Time values in SQLite
Re: How to store/retrieve Time values in SQLite
Hello,
If you use a REAL field to store date, then, to retrieve a readable date value, you should use data type mapping when both selecting and editing this field, e.g.:
ddl
select
insert
If you use a REAL field to store date, then, to retrieve a readable date value, you should use data type mapping when both selecting and editing this field, e.g.:
ddl
Code: Select all
CREATE TABLE test (
f_id INTEGER,
f_time REAL)select
Code: Select all
select f_id, time(f_time) as f_time from test Code: Select all
INSERT INTO test (f_id, f_time) VALUES (:f_id, cast(:f_time as REAL))