pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Blixt <robert.blixt@transpa.se>
To: pgsql-sql@postgresql.org
Subject: Extract week from date, start with sunday
Date: Mon, 7 Nov 2005 14:47:35 +0100
Message-ID: <20051107140036.11DC6D6873@svr1.postgresql.org> (raw)


 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





view thread (4+ messages)  latest in thread

Message-ID: <20051107140036.11DC6D6873@svr1.postgresql.org>
Permalink:  ../20051107140036.11DC6D6873@svr1.postgresql.org/
Also on:    postgresql.org/message-id/20051107140036.11DC6D6873@svr1.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: robert.blixt@transpa.se
  Subject: Re: Extract week from date, start with sunday
  In-Reply-To: <20051107140036.11DC6D6873@svr1.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox