Re: [sqlite] Date functions

2007-12-02 Thread John Stanton
Sqlite uses an epoch based date like the Unix timestamp, but realised in 
a 64 bit floating point number.  It has a set of inbuilt functions to 
process these timestamps.  See date.c for full details.


Using the FP format of the date and time will work well in your application.

You can add date funtionality to Sqlite in your application interface. 
For example we add a DATE and a DATETIME type and perform date and time 
artihmetic.


Andreas Volz wrote:

Hello,

I like to save a date for each row in my database. Later I would select
the rows with a query:

SELECT *
FROM Store_Information
WHERE Date BETWEEN 'Jan-06-1999' AND 'Jan-10-1999'

Is there a date data type in sqlite? I've not found it in the docs.

If not, I had the idea to use UNIX timestamps for my date column. So
I've only integers and could select and convert them in my C code.

regards
Andreas

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




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



Re: [sqlite] Date functions

2007-12-02 Thread

Hi Andreas,

I like to save a date for each row in my database. Later I would  
select the rows with a query:


SELECT *
FROM Store_Information
WHERE Date BETWEEN 'Jan-06-1999' AND 'Jan-10-1999'

Is there a date data type in sqlite? I've not found it in the docs.



Store dates in this format: -MM-DD such as 2007-12-02

Use dates like this:

select *
from Store_Information
where Date between '1999-01-06' and '1999-01-06'

Some documentation is here:
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

Tom


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



[sqlite] Date functions

2007-12-02 Thread Andreas Volz
Hello,

I like to save a date for each row in my database. Later I would select
the rows with a query:

SELECT *
FROM Store_Information
WHERE Date BETWEEN 'Jan-06-1999' AND 'Jan-10-1999'

Is there a date data type in sqlite? I've not found it in the docs.

If not, I had the idea to use UNIX timestamps for my date column. So
I've only integers and could select and convert them in my C code.

regards
Andreas

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