SHARE
TWEET

Jeffrey04

a guest Aug 26th, 2008 152 Never
  1. SELECT  COUNT(*) AS total_days
  2. FROM    (SELECT date '2008-8-26' + generate_series(0, (date '2008-9-1' - date '2008-8-26')) AS all_days) AS calendar
  3. WHERE   EXTRACT(isodow FROM all_days) < 6;
  4. -- based on http://pastebin.com/m4c143e84
RAW Paste Data
Top