If you make your date and time columns numeric (floating point) you use 8 bytes to store a date and time. You then use the embedded Sqlite date and time functions to present date and time as your application chooses.

I believe that if you declare the column as DATE Sqlite will give it an underlying type of numeric. Look at Sqlite's "manifest typing" to see how it ignores the SQL data types and stores information in the way it chooses as most appropriate.

Look at date.c to get an idea of the inbuilt Sqlite date and time support.

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.
Thanks
Joanne



----- 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 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 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


     
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------


      
____________________________________________________________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to