My guess is that string comparison is taking place, and so "2008-01-01" is
less than "2008-01-01 00:00:00".

HTH,
Igor
 
-----Original Message-----
From: Doug Van Horn [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 06, 2007 5:48 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Querying DATE column with date/time string.


Hi,

I'm running into a problem with the database library in Django running
against SQLite.  I'm trying to understand why the following happens:

$ sqlite3 date_test
SQLite version 3.4.2
Enter ".help" for instructions
sqlite> create table foo (d date null);
sqlite> insert into foo (d) values ('2008-01-01'); select d from foo 
sqlite> where d between '2008-01-01' and '2008-01-31';
2008-01-01
sqlite> select d from foo where d between '2008-01-01 00:00:00' and
'2008-01-31 23:59:59.999999';
sqlite> .quit

In English, why does adding the 'time' portion to the between clause not
find the record?


Thanks for any help or insights...

Doug Van Horn
--
View this message in context:
http://www.nabble.com/Querying-DATE-column-with-date-time-string.-tf4956413.
html#a14193493
Sent from the SQLite mailing list archive at Nabble.com.


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



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

Reply via email to