<https://stackoverflow.com/a/14922447/1568948>
# general
c
thanks but this is returning the dreaded ” ERROR: Invalid Expression ” since this is a SQL statement rather than a case statement, even cutting out just the case statements still errors unless I am doing it wrong
ideally it works the same as networkdays in excel
m
It works for me (after changing
CompleteDate
to
{today}
and
InstallDate
to
trandate
)
(TRUNC({today}) - TRUNC({trandate}) ) +1 -   ((((TRUNC({today},'D'))-(TRUNC({trandate},'D')))/7)*2) -  (CASE WHEN TO_CHAR({trandate},'DY','nls_date_language=english')='SUN' THEN 1 ELSE 0 END) -  (CASE WHEN TO_CHAR({today},'DY','nls_date_language=english')='SAT' THEN 1 ELSE 0 END)
c
@michoel dude thank you so so so much
worked beautifully