Sunday, August 20, 2017

How to set company wise month


SQL> select MAX(ADD_MONTHS(trunc(at_dt,'MON')+25,-1)) into :dt1 from emp_attn_data
  2    where at_dt <> (select max(add_months(trunc(at_dt,'mon')+25,0)) from emp_attn_data);

MAX(ADD_M
---------
26-JUL-17

SQL> select MAX(ADD_MONTHS(trunc(at_dt,'MON')+25,-1)) into :adt from emp_attn_data;

MAX(ADD_M
---------
26-JUL-17

SQL> select MAX(trunc(at_dt,'MON')+24) into :adt from emp_attn_data;

MAX(TRUNC
---------
25-AUG-17

No comments:

Post a Comment

How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10

#########################Install Oracle  APEX 24.1################################ ----------------------------------------------------...