Extract week from date, start with sunday

From: "Robert Blixt" <robert(dot)blixt(at)transpa(dot)se>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Extract week from date, start with sunday
Date: 2005-11-07 13:47:35
Message-ID: 20051107140036.11DC6D6873@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi,

I am currently extracting my weeks from a date like this..

SELECT INTO extractweek EXTRACT( week FROM ldate );

This works fine, except that this assumes (according
to ISO standard) that weeks starts with Monday.

I need the weeks to start with Sunday instead, otherwise
I will not get the correct week.

Is there a workaround for this?

Thanks!

Kind Regards,
Robert

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2005-11-07 14:27:48 Re: Extract week from date, start with sunday
Previous Message Tai Huynh Phuoc 2005-11-05 19:10:19 Insert large text to text column