Subject Re: [firebird-support] Re: EXTRACT(WEEK FROM DATE) - how to get the right year?
Author Dom Scarlatti
At 11:01 PM 21/12/2008, you wrote:
>--- 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

Firebird complies with the ISO standard. You can't tweak it to work some other way, so using this method doesn't depend on where you live, but whether your requirements comply with the international standards.

Dom