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
days','
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 ('2011-12-04 ',' weekday 6 ')
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. But
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]
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:
>
>
> select * from TABLE
> insert into t values('2011-10-10');
sqlite> insert into t values('2011-10-11');
sqlite> insert into t values('2011-10-12');
sqlite> insert into t values('2011-10-13');
sqlite> insert into t values('2011-10-14');
sqlite> insert
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 date('n
7 matches
Mail list logo