Re: Setting week starting day (was: Re: Tabulate data incrementally)

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jorge Godoy <jgodoy(at)gmail(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Setting week starting day (was: Re: Tabulate data incrementally)
Date: 2007-03-08 22:10:47
Message-ID: 20070308221047.GE4715@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jorge Godoy escribió:

> I mean, if I wanted to do the above but instead of Sunday or Monday as the
> starting day I'd like using Fridays or Wednesdays...
>
> Is it possible? Writing a new function shouldn't be too hard -- it's a matter
> of truncating the week on a day and shifting the date forward or backward --,
> but something like a "SET bow=5" (to make the API consistent with the 'dow'
> that already exists) would be really great!

Is it not just a matter of adding a constant and then taking modulo 7?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message D Unit 2007-03-08 22:12:20 Solaris and Ident
Previous Message Charlie Clark 2007-03-08 22:09:43 Weird behaviour on a join with multiple keys