Re: Need to omit time during weekends from age calculations

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Need to omit time during weekends from age calculations
Date: 2021-06-07 19:17:35
Message-ID: 55a3b160-8ccf-ca96-f654-1dcc6cf3b8d7@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2021-06-07 19:34:56 Re: Need to omit time during weekends from age calculations
Previous Message David Gauthier 2021-06-07 19:12:20 Need to omit time during weekends from age calculations