Re: [sqlite] Data storage : Boolean and Date

2009-09-29 Thread Romain Perney
Thanks a lot Igor, that's just what I wanted to know.

Igor Tandetnik wrote:
>/ - what is the best way to store date-time values with sqlite3?
/
This depends on what you plan to do with them. If you need to manipulate 
the dates in your SQL queries (as opposed to just shuffling them in and 
out), then you want one of the formats understood by SQLite's built-in 
date/time functions:

http://www.sqlite.org/lang_datefunc.html

Here you have a choice of a string like '2009-09-29 07:44:00', a Julian 
day (a double with whole part representing date and fracional part 
representing time) or a traditional Unix time (the number of seconds 
since midnight 1/1/1970).

If you don't need to manipulate these fields in your SQL, then you can 
choose any format you want. E.g. in my application I find it convenient 
to store dates as integers like 20090929 (I don't need times).

>/ - to store boolean values?
/
As integer 0 or 1.

Igor Tandetnik 

-- 
Romain PERNEY 



Tel : 01.53.21.99.20
CARDIWEB - Business & Technology
29 Cité d'Antin - 75009 PARIS
 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Data storage : Boolean and Date

2009-09-29 Thread Romain Perney
Hi all,

I'm new to the list, and I can't find any archive to look trough...
My questions was :
- what is the best way to store date-time values with sqlite3?
- to store boolean values?

I assume INTEGER is the solution, but I wanted to know if there was some 
convention about that...
Thanks for your help,

-- 
Romain PERNEY 



Tel : 01.53.21.99.20
CARDIWEB - Business & Technology
29 Cité d'Antin - 75009 PARIS
 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users