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

2007-12-17 Thread John Stanton
code that work for C++ in this case. Sorry for the question. Thanks, JP - Original Message From: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, December 17, 2007 12:59:00 PM Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETI

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 datatype

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

2007-12-17 Thread Joanne Pham
-users@sqlite.org Sent: Monday, December 17, 2007 12:59:00 PM Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER. 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 declar

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

2007-12-17 Thread John Stanton
instead of DATETIME. Thanks, Joanne - Original Message From: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, December 17, 2007 10:00:11 AM Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER. If you declared yo

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 if

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

2007-12-17 Thread Joanne Pham
Monday, December 17, 2007 10:00:11 AM Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME or INTEGER. 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 yo

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

2007-12-17 Thread John Stanton
t: Thursday, December 13, 2007 2:48:26 PM Subject: Re: [sqlite] create table with datatype = DATE CREATE TABLE test (.. createData DATETIME DEFAULT CURRENT_TIMESTAMP) On 12/13/07, Joanne Pham <[EMAIL PROTECTED]> wrote: Hi All, I create the table as : create table test (name varchar(30)

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

2007-12-17 Thread Joanne Pham
t;[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, December 13, 2007 2:48:26 PM Subject: Re: [sqlite] create table with datatype = DATE CREATE TABLE test (.. createData DATETIME DEFAULT CURRENT_TIMESTAMP) On 12/13/07, Joanne Pham <[EMAIL PROTECTED]> wrote: > Hi All, >

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

2007-12-14 Thread John Stanton
m: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, December 13, 2007 3:05:52 PM Subject: Re: [sqlite] create table with datatype = DATE The type DATE is a declared type, not an actual type and has no effect u nless your code specifically picks it out as a declar

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

2007-12-14 Thread Dennis Cote
Joanne Pham wrote: Hi All, Should I create the column in DATETIME or the INTEGER to store the time. DATETIME has the value of GMT time. So I store this value as INTEGER then I need to convert datetime format but it will be use less space if I use the INTEGER. Please give me an advice. See

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

2007-12-14 Thread Joanne Pham
- Original Message From: John Stanton <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, December 13, 2007 3:05:52 PM Subject: Re: [sqlite] create table with datatype = DATE The type DATE is a declared type, not an actual type and has no effect u nless your code specifically picks

Re: [sqlite] create table with datatype = DATE

2007-12-13 Thread John Stanton
The type DATE is a declared type, not an actual type and has no effect u nless your code specifically picks it out as a declared type. To do what you want use a trigger on insert and update the date field with datetime('now'); Joanne Pham wrote: Hi All, I create the table as : create tab

Re: [sqlite] create table with datatype = DATE

2007-12-13 Thread
Hi Joanne, create table test (name varchar(30), createDate DATE default DATETIME('NOW')); but I got the error message. I want to have the default as now if it is not specify. create table Test (Name text, createDate Date default current_date); Tom -

Re: [sqlite] create table with datatype = DATE

2007-12-13 Thread P Kishor
CREATE TABLE test (.. createData DATETIME DEFAULT CURRENT_TIMESTAMP) On 12/13/07, Joanne Pham <[EMAIL PROTECTED]> wrote: > Hi All, > I create the table as : > create table test (name varchar(30), createDate DATE default > DATETIME('NOW')); > but I got the error message. I want to have the def

[sqlite] create table with datatype = DATE

2007-12-13 Thread Joanne Pham
Hi All, I create the table as : create table test (name varchar(30), createDate DATE default DATETIME('NOW')); but I got the error message. I want to have the default as now if it is not specify. Thanks in advance, Joanne __