pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: pgsql-sql@postgresql.org
Subject: workday function
Date: Tue, 15 May 2007 09:51:34 +0100
Message-ID: <200705150951.34928.gary.stainburn@ringways.co.uk> (raw)

Hi folks

I need to be able to add and subtract workdays, something like

select CURRENT_DATE - '3 work days'::interval;

I can't see how to do this natively so I'm looking to write a function to do 
it and was wondering if anyone's already done it.

While Googling I've found that MS Excel has a workday function which seems to 
do what I want.

Any help would be appreciated.
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     



view thread (8+ messages)  latest in thread

Message-ID: <200705150951.34928.gary.stainburn@ringways.co.uk>
Permalink:  ../200705150951.34928.gary.stainburn@ringways.co.uk/
Also on:    postgresql.org/message-id/200705150951.34928.gary.stainburn@ringways.co.uk

 · 

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: gary.stainburn@ringways.co.uk
  Subject: Re: workday function
  In-Reply-To: <200705150951.34928.gary.stainburn@ringways.co.uk>

* 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