John D. Burger wrote:
There was a brief discussion of this just last week, with a few solutions
suggested:

http://archives.postgresql.org/pgsql-general/2007-04/msg01098.php

Rich Shepard wrote:
  That thread asked how to find business days between any two specified
dates. I would like to create a calendar table that includes business days,
holidays, Julianized dates, and other interesting tid-bits that are of value in a business application. Then dates can be looked up in the table to learn
their attributes and the calculations don't need to be done each time.

The best solution I've encountered so far to this type of problem is to have a table of "days" with columns like isWeekday, isHoliday, julianDay, otherTidbit, ...

Then you select or join the days within the interval of interest and factor out weekdays, or holidays, or whatever.

--
Lew

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to