Need to omit time during weekends from age calculations

Поиск
Список
Период
Сортировка
От David Gauthier
Тема Need to omit time during weekends from age calculations
Дата
Msg-id CAMBRECBCO3toxcCXRNxZqxqyYyNKdu7icy6x_B0Ln7vdD6uyQw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Need to omit time during weekends from age calculations  (Ron <ronljohnsonjr@gmail.com>)
Re: Need to omit time during weekends from age calculations  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
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.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Dean Gibson (DB Administrator)"
Дата:
Сообщение: Re: bottom / top posting
Следующее
От: Ron
Дата:
Сообщение: Re: Need to omit time during weekends from age calculations