Hi Dave,
I made some investigation based also on the file posted by LuizAmerico.
To be more precise, based on the information you sent me I have installed sqlite 3 under Linux, more precisely Ubuntu 9.10 using a virtual machine.
Installing sqlite in Ubuntu is quite simple and straight forward. It is enough to enter this command at the prompt:
$ sudo apt-get install sqlite3
Once sqlite has been installed I have used the sqlite3 command line utility to create a database blood.db:
alberto@Ubuntu:~/download$ sqlite3 ./blood.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
At this point I have created a table like the one used by LuizAmerico that is having a subset of the column you have in your table:
sqlite> PRAGMA foreign_keys=OFF;
sqlite> BEGIN TRANSACTION;
sqlite> CREATE TABLE [blood] (
...> [readID] INTEGER NULL,
...> [Day] VARCHAR(255) NULL,
...> [readDate] DATE NULL,
...> [ReadTime] TIME NULL
...> );
sqlite> INSERT INTO "blood" VALUES(68,'Tuesday',40162,'16:28');
sqlite> INSERT INTO "blood" VALUES(69,'Tuesday',40162,'21:25');
sqlite> INSERT INTO "blood" VALUES(70,'Wednesday',40163,'07:16');
sqlite> INSERT INTO "blood" VALUES(71,'Wednesday',40163,'16:30');
sqlite> INSERT INTO "blood" VALUES(72,'Wednesday',40163,21.35);
sqlite> INSERT INTO "blood" VALUES(73,'Thursday',40164,'08:17');
sqlite> INSERT INTO "blood" VALUES(74,'Thursday',40164,'16:15');
sqlite> INSERT INTO "blood" VALUES(75,'Thursday',40164,'22:23');
sqlite> INSERT INTO "blood" VALUES(76,'Friday',40165,'09:40');
sqlite> INSERT INTO "blood" VALUES(77,'Friday',40165,'17:24');
sqlite> COMMIT;
After this command I have made a select to check if the value have been entered correctly:
sqlite> select * from blood;
68|Tuesday|40162|16:28
69|Tuesday|40162|21:25
70|Wednesday|40163|07:16
71|Wednesday|40163|16:30
72|Wednesday|40163|21.35
73|Thursday|40164|08:17
74|Thursday|40164|16:15
75|Thursday|40164|22:23
76|Friday|40165|09:40
77|Friday|40165|17:24Now, I was curious to see if creating a new record with a standard SQLite function to get the current date (date('now')) the date was going to be created with the same format. And here is the result:
sqlite> insert into blood values(99,'Tuesday',date('now'),strftime('%H:%M','now'));
sqlite> select * from blood;
68|Tuesday|40162|16:28
69|Tuesday|40162|21:25
70|Wednesday|40163|07:16
71|Wednesday|40163|16:30
72|Wednesday|40163|21.35
73|Thursday|40164|08:17
74|Thursday|40164|16:15
75|Thursday|40164|22:23
76|Friday|40165|09:40
77|Friday|40165|17:24
99|Tuesday|2009-12-24|17:07
sqlite>
As you can see the date was inserted in the way I was expecting. I still do not understand why your table is having dates in this format.
So here are my questions:
- Is this a table already existing or records are created with an application?
- Why dates are created in a different way than standard SQLite format?
- Could you consider converting your dates in the standard format?
Another question to understand better your problem:
- Specify which Linux distribution and version you are using;
- Specify which SQLite library version you are using. When you start sqlite3 command you can see the version;
- Specify how records have been created in that table.
If you have additional questions just let me know.
Regards.
Alberto.