Subject Re: extract(week from d)
Author lacakus
> This still does not look like clear/exact specification.
> If you really had function that would return number 1-53, than
>
> - your query would group week 5 from 2006 with week 5 from 2005 with
week 5 from 2004 ...
> Is it what you want ?
>
Yes you are right, but in my real app there will be no records older
than 1 year

> - first day of year 2006-01-01 belongs to week 52/2005,
> last day of year 2006-12-31 belongs to week 52/2006,
> i.e. both would fall into the same group 52.
> Is it what you want ?
>
Yes

-Laco.