Greetings!
I know that SQLite dates are of the form YYYY-MM-DD and I like that. :-) I
want to find out why these are working.
create table t (a date, val integer);
insert into t values ('2010-01-01', 10);
insert into t values ('2010-1-1', 10);
insert into t values ('2010-1-01', 10);
insert into t values ('2010-02-01', 10);
insert into t values ('2010-2-01', 10);
select sum(val) from t where a BETWEEN '2010-01-01' AND '2010-01-31';
select sum(val) from t where a BETWEEN '2010-01-01' AND '2010-02-01';
select sum(val) from t where a BETWEEN '2010-01-01' AND '2010-12-31';
sqlite> select sum(val) from t where a BETWEEN '2010-01-01' AND
'2010-01-31';
10
sqlite> select sum(val) from t where a BETWEEN '2010-01-01' AND
'2010-02-01';
20
sqlite> select sum(val) from t where a BETWEEN '2010-01-01' AND
'2010-12-31';
40
Thoughts? Thanks.
josé
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users