Answers for "oracle sql select all days between two dates except weekends"

SQL
4

oracle sql select all days between two dates except weekends

-- All dates between 01/07/2021 and 15/07/2021 excluding weekends
SELECT CAL_DATE
FROM (
         SELECT to_date('01/07/2021', 'DD/MM/YYYY') + ROWNUM - 1 AS CAL_DATE
         FROM ALL_OBJECTS
         WHERE ROWNUM <= to_date('15/07/2021', 'DD/MM/YYYY') 
                             - to_date('01/07/2021', 'DD/MM/YYYY') + 1)
WHERE to_char(CAL_DATE, 'DY', 'NLS_DATE_LANGUAGE=AMERICAN') NOT IN ('SAT', 'SUN');
Posted by: Guest on July-13-2021
0

oracle sql all days except weekends

WHERE TO_CHAR(date_column, 'DY','NLS_DATE_LANGUAGE=AMERICAN') NOT IN ('SAT', 'SUN')
Posted by: Guest on July-13-2021

Code answers related to "oracle sql select all days between two dates except weekends"

Code answers related to "SQL"

Browse Popular Code Answers by Language