Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle VM What's New

Honglin Su-OracleMay 18 2015 — edited Nov 9 2016

Please review the specific download instructions here.

Oracle VM Manager and Oracle VM Server for x86

Oracle Private Cloud Appliance

Windows PV Drivers

Oracle VM Server for SPARC

Comments

Karthick2003
SQL> select case when extract(month from sysdate) between 1 and 9 then add_months(trunc(sysdate,'year'),-3)
  2              else add_months(trunc(sysdate,'year'),9)
  3         end
  4         as dt
  5    from dual
  6  /

DT
---------
01-OCT-08
Frank Kulash
Hi,

Welcome to the forum!

Another approach:
ADD_MONTHS ( TRUNC ( ADD_MONTHS ( dt
                                , 3
                                )
                   , 'YYYY'
                   )
           , -3
           )
Aketi Jyuuzou
We can use "add_months" B-)
select column_value,
extract(year from add_months(column_value,-9)) as y,
add_months(trunc(add_months(column_value,-9),'yyyy'),9) as oct
from table(sys.odciDateList(
date '2009-01-01',date '2009-09-01',
date '2009-10-01',date '2009-12-01'));

COLUMN_V     Y  OCT
--------  ----  --------
09-01-01  2008  08-10-01
09-09-01  2008  08-10-01
09-10-01  2009  09-10-01
09-12-01  2009  09-10-01
838267
If your fiscal year starts on 7/1, here is a way to provide the first day in a date field.

SELECT CASE
WHEN TO_CHAR(SYSDATE, 'MM') IN ('7','8','9','10','11','12')
then to_date(to_char(sysdate,'YYYY')||'0701','YYYYMMDD')
ELSE to_date (TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE, 'YYYY') ) - 1 )||'0701','YYYYMMDD')
END
FROM DUAL;
Ganesh Srivatsav
another way,
SQL> SELECT ADD_MONTHS (TRUNC (SYSDATE, 'year')
  2                    ,DECODE (GREATEST (9, TO_CHAR (SYSDATE, 'MM')), 9, -3, 10)) dt
  3    FROM DUAL;
DT
---------
01-OCT-10
SQL> 
G.
1 - 5

Post Details

Added on May 18 2015
0 comments
2,848 views