Bernandas Savarimuthu
SQL & PL/SQL Colletions
Thursday, June 24, 2010
Select Day count Excluding Saturday and Sunday for the Date range
SELECT
COUNT(DECODE(TO_CHAR(TO_DATE('Start Date','DD/MM/YYYY')+LEVEL-1,'D'),7,NULL,1,NULL,1)) FROM DUAL
CONNECT BY LEVEL <= TO_DATE('End Date','DD/MM/YYYY') -TO_DATE('Start Date','DD/MM/YYYY')+1;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment