Oracle – Number of Weekdays Between Two Dates

Hey everyone,

Just a quick post on how to select the number of weekdays between two dates:

SELECT temp_tbl.days
--SELECT COUNT(temp_tbl.days)
FROM (          
        SELECT (TRUNC(TO_DATE ('01/08/2012', 'DD/MM/YYYY'), 'dd') + LEVEL - 1) days
        FROM DUAL
        CONNECT BY LEVEL = 2
      AND TO_CHAR(temp_tbl.days, 'D') <= 6

Posted

in

by

Tags:

Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

%d bloggers like this: