From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Need to omit time during weekends from age calculations
Date: Mon, 7 Jun 2021 14:17:35 -0500
Message-ID: <55a3b160-8ccf-ca96-f654-1dcc6cf3b8d7@gmail.com> (raw)
In-Reply-To: <CAMBRECBCO3toxcCXRNxZqxqyYyNKdu7icy6x_B0Ln7vdD6uyQw@mail.gmail.com>
References: <CAMBRECBCO3toxcCXRNxZqxqyYyNKdu7icy6x_B0Ln7vdD6uyQw@mail.gmail.com>
On 6/7/21 2:12 PM, David Gauthier wrote:
> Hi:
>
> I suspect I'm not the first to ask about this but couldn't find anything
> after googling for a bit. So here goes....
>
> I'd like to get the "age" difference between two times which span either
> all or part of a weekend but exclude any time that transpired during the
> weekend.
> Example (please pardon the non-timestamp vals here...)
>
> age('Monday-Noon','Prev-Friday-Noon')
> would give me '1 day'.
>
> ...and...
>
> age('Sunday-Noon','Prev-Friday-Noon')
> would give me '12 hours'
>
> You get the picture.
>
> Has this wheel already been invented ?
> I don't see an easy way to do this off-hand.
> All Ears :-)
>
> Thanks in Advance.
You seem to be asking about counting work days. Am I misunderstanding?
--
Angular momentum makes the world go 'round.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: Need to omit time during weekends from age calculations
In-Reply-To: <55a3b160-8ccf-ca96-f654-1dcc6cf3b8d7@gmail.com>
References: <CAMBRECBCO3toxcCXRNxZqxqyYyNKdu7icy6x_B0Ln7vdD6uyQw@mail.gmail.com> <55a3b160-8ccf-ca96-f654-1dcc6cf3b8d7@gmail.com>
* 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