Subject Re: [firebird-support] Re: extract(week from d)
Author Ivan Prenosil
> but I want make select like this (weekly summary) :
>
> select extract(week from datum) as w, sum(some_data) as total
> from t
> where ...
> GROUP BY extract(week from datum)

So, you actually do not need the week number,
but just to group by weeks sequentially, do you ???

Try this

select (datum - date'1900-1-1')/7, sum(some_data) as total
from t
where ...
GROUP BY (datum - date'1900-1-1')/7

Ivan
http://www.volny.cz/iprenosil/interbase/