Re: Business days

Поиск
Список
Период
Сортировка
От John D. Burger
Тема Re: Business days
Дата
Msg-id 596BB93D-71F0-41CE-9A96-DB9855CF4999@mitre.org
обсуждение исходный текст
Ответ на Re: Business days  ("Greg Sabino Mullane" <greg@turnstep.com>)
Ответы Re: Business days
Список pgsql-general
> - -- I need to get the a total number of business days (from monday to
> - -- friday) between two dates.
> - -- Someone can help me please.
>
> A simplistic approach that counts a "business day" as being Monday
> through Friday would be something like this:

> However, you quickly run into the problem of holidays. While you
> could construct a helper table listing all the holidays, ones that
> don't fall on the same day every year (e.g. Easter) will trip
> you up.

Er, isn't Easter usually on a Sunday?  Anyway, I also found this, the
first hit if you google "sql holidays":

http://www.sqlmag.com/Article/ArticleID/25899/sql_server_25899.html

The big ugly union might need to be munged a bit, but most of the non-
weekend US holidays seem to be there.

- John D. Burger
   MITRE



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

Предыдущее
От: Ron Mayer
Дата:
Сообщение: Re: Feature request - have postgresql log warning when new sub-release comes out.
Следующее
От: Leonel
Дата:
Сообщение: Re: Feature request - have postgresql log warning when new sub-release comes out.