[sqlite] Re: baffled by dates

2007-06-04 Thread Igor Tandetnik

Chris Fonnesbeck
 wrote:

On 6/4/07, P Kishor <[EMAIL PROTECTED]>
wrote:


There is no "DATE" format in SQLite.


Wow, thanks. So, why does this table creation work then, and not give
an error?

CREATE TABLE PIT_manatees(Manatee_Log INTEGER, Name text,
First_Capture date, Recovered date, Coast text)


SQLite will accept pretty much anything as a column type. For details, 
see


http://sqlite.org/datatype3.html

Igor Tandetnik 



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



[sqlite] Re: baffled by dates

2007-06-05 Thread Chris Fonnesbeck

Thanks to everyone for their help and advice. I think I get it now.

Cheers,
cf

On 6/4/07, Chris Fonnesbeck <[EMAIL PROTECTED]> wrote:


I'm at a complete loss about how to work with dates in SQLite. The
documentation doesnt seem to be helping me. I have a table with some date
fields, in the proper -mm-dd format:

sqlite> select First_Capture from PIT_manatees limit 5;
1997-6-17
1998-5-6
1997-6-24
1998-5-6
2000-3-15

however, it does not respond properly to comparisons to dates:

sqlite> select First_Capture from PIT_manatees where
First_Capture<2000-1-1 limit 5;
sqlite>

this doesnt work either:

sqlite> select First_Capture from PIT_manatees where
First_Capture

note that these columns are in the 'date' format.

Yet more strangeness:


sqlite> select date(First_Capture) from PIT_manatees limit 10;







1999-10-13


sqlite>

Not sure what that is all about -- all the results are blank except one,
ewven though every record is in exactly the same format.

I'm totally perplexed by date handling in SQLite, so any help is most
appreciated.

Thanks,
--
Christopher J. Fonnesbeck

Population Ecologist, Marine Mammal Section
Fish & Wildlife Research Institute (FWC)
St. Petersburg, FL

Adjunct Assistant Professor
Warnell School of Forestry and Natural Resources
University of Georgia
Athens, GA

T: 727.235.5570
E: Chris dot Fonnesbeck at MyFWC dot com





--
Christopher J. Fonnesbeck

Population Ecologist, Marine Mammal Section
Fish & Wildlife Research Institute (FWC)
St. Petersburg, FL

Adjunct Assistant Professor
Warnell School of Forestry and Natural Resources
University of Georgia
Athens, GA

T: 727.235.5570
E: Chris dot Fonnesbeck at MyFWC dot com