Subject Re: extract(week from d)
Author legrand_legrand_63
>
> I prefer following ISO 8601 standard, so 2006-01-01 belongs to last
> week of 2005 and First week of 2006 begins with 2006-01-02.
> Exactly so as in my paper-calender on my desk :-)
>
> PostgreSQL documentation says:
> By definition (ISO 8601), the first week of a year contains January 4
> of that year. (The ISO-8601 week starts on Monday.) In other words, the
> first Thursday of a year is in week 1 of that year.
>
> -Laco.
>

Hello,
Could you try TO_CHAR(d,'IW') from the following ?
http://perso.orange.fr/Udf4ORA/

Version 0.0.2 will return 01-01-2006 as last day of week 52

Regards
PAscal