Subject Re: EXTRACT(WEEK FROM DATE) - how to get the right year?
Author Thomas Kellerer
--- In firebird-support@yahoogroups.com, Dom Scarlatti >
> alter table xyz
> add WeekOfTheYear
> computed by (
>
> case
> when (extract(month from CertainDate) = 12)
> and (extract(week from CertainDate) = 1)
> then
> 'Week '||extract (WEEK from CertainDate)||' of year '
> || (1 + (extract( year from CertainDate)))
>
> else 'Week '||extract (WEEK from CertainDate)||' of year '
> ||extract( year from CertainDate)
> end )
>
> Dom
>
Just be careful in which area of the world you are.

There are different system on what the "first" week is:
http://en.wikipedia.org/wiki/Week#Week_number