Hello All,
Is the below query appropriate and best to use to get the last working day of the month ?
SELECT to_date('13.08.2014','dd.mm.yyyy') + MAX(RNUM) LastDay(nonweekend)
FROM (SELECT ROWNUM RNUM
FROM ALL_OBJECTS where rownum <=31)
WHERE ROWNUM <= 31 ANd
TO_CHAR(to_date('13.08.2014','dd.mm.yyyy') + RNUM, 'DY','NLS_DATE_LANGUAGE=ENGLISH' ) NOT IN ('SAT' , 'SUN')
and to_date('13.08.2014','dd.mm.yyyy') + RNUM <= last_day(to_date('13.08.2014','dd.mm.yyyy'))
I have to use this query in production.
Is this advisable to use ?