[sqlite] Time and date functions

2011-10-16 Thread Nando
Thank you all. The solution of Jean-Christophe is perfect and thanks to Igor and Michael I begin to understand the logic of the processing of dates in SQLite, which is much more powerful than it had expected at first. sqlite> select * from fechas where fecha between date('2011-12-18','-6

Re: [sqlite] Time and date functions

2011-10-15 Thread Igor Tandetnik
Nando wrote: > I just realized that the "weekday" is not working as and believed, but is > much easier. I can make simple queries of the form: > > select * from dates WHERE date = date ('2011-12-09 ',' weekday 5 '); > > Or > > select * from dates WHERE date <= date

Re: [sqlite] Time and date functions

2011-10-15 Thread Nando
I just realized that the "weekday" is not working as and believed, but is much easier. I can make simple queries of the form: select * from dates WHERE date = date ('2011-12-09 ',' weekday 5 '); Or select * from dates WHERE date <= date ('2011-12-04 ',' weekday 6 '); And they work properly.

Re: [sqlite] Time and date functions

2011-10-15 Thread Jean-Christophe Deschamps
select * from TABLE where DATE between date('now','-7 days','Weekday 0') and date('now','-7 days','Weekday 6'); Let me try this: select * from TABLE where DATE between date('now','-6 days','Weekday 0') and date('now','Weekday 6'); or compare week numbers (%W specification) [slower]

Re: [sqlite] Time and date functions

2011-10-15 Thread Igor Tandetnik
Nando wrote: > SQLite system for working with dates is very powerful, but I find it > strange. I'm trying to select the dates between the beginning and end of a > week defined from the date of a given day. If I understand the documentation > thing this code should work: > >

Re: [sqlite] Time and date functions

2011-10-15 Thread Black, Michael (IS)
Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Nando [fl446...@gmail.com] Sent: Saturday, October 15, 2011 4:17 PM To: sqlite-users@sqlite.org Su

[sqlite] Time and date functions

2011-10-15 Thread Nando
SQLite system for working with dates is very powerful, but I find it strange. I'm trying to select the dates between the beginning and end of a week defined from the date of a given day. If I understand the documentation thing this code should work: select * from TABLE where DATE between