Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread John Stanton
Joanne, there are no bad questions, only bad answers. Use sqlite3_bind_double and your timestamp will be of type double (a 64 bit FP number), Joanne Pham wrote: Hi John, Thanks for the detail info. I am still very new to SQLite3 and sorry for the question. My application is used C++ to

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread Dennis Cote
Joanne Pham wrote: My application is used C++ to insert/select the data from this table. So if I defined it as create table mytable ( createDate REAL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (remoteWXId) ); Then I can use sqlite3_bind_real to bind the column but what is the

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread Joanne Pham
Hi John, Thanks for the detail info. I am still very new to SQLite3 and sorry for the question. My application is used C++ to insert/select the data from this table. So if I defined it as create table mytable ( createDate REAL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (remoteWXId) );

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread John Stanton
Sqlite stores a date and time as a REAL so instead of trusting to manifest typing to make it a REAL your code will be easier to follow if you declare it a REAL. Here is a simple list of the date and time functions embedded in Sqlite 1. date( timestring, modifier, modifier, ...) returns

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread Dennis Cote
Joanne Pham wrote: I have two question regarding DATETIME column data type: 1 ) Should I store my COLUMN as INTEGER instead of DATETIME. Is it easier if this column type is INTEGER vs DATETIME then do the conversion in the GUI code to convert from INTEGER TO DATETIME. 2) And

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread Joanne Pham
Thanks John, " If you make it a REAL instead of DATETIME your code will be clearer." So you meant that I should make my datatype as REAL instead of DATETIME. Thanks, Joanne - Original Message From: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, December

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread John Stanton
If you declared your date and time (timestamp) column DATETIME it will be floating point and will store date and time in 8 bytes. Use the FP bind function. If you make it a REAL instead of DATETIME your code will be clearer. Joanne Pham wrote: Hi All, I have two question regarding DATETIME

Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER.

2007-12-17 Thread Joanne Pham
Hi All, I have two question regarding DATETIME column data type: 1 ) Should I store my COLUMN as INTEGER instead of DATETIME. Is it easier if this column type is INTEGER vs DATETIME then do the conversion in the GUI code to convert from INTEGER TO DATETIME. 2) And if I store as