1

Is there a way in ORACLE that can display the Fiscal Year?

For example, I can write this query in SQL SERVER to pull the FYs but don't know how to write it in ORACLE.

SELECT
DATEPART(yyyy, DATEADD(mm, 3, DATE)) AS FY
FROM MYTABLE

Output:

FY
----
2009
2010
2011

What can I try to resolve this?

halfer
  • 19,824
  • 17
  • 99
  • 186
joe
  • 1,463
  • 7
  • 31
  • 45

2 Answers2

2

The Oracle equivalent of your query would be something like this:

SELECT EXTRACT(YEAR FROM ADD_MONTHS(MYDATE, 3)) AS FY
FROM MYTABLE
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • 1
    If you want to be totally standards compliant, use *EXTRACT(YEAR FROM mydate + INTERVAL '3' MONTH)* –  Dec 14 '10 at 18:54
0
SELECT TO_CHAR(ADD_MONTHS(MYDATE, 3),'YYYY') fy FROM MYTABLE

Is probably the same

stjohnroe
  • 3,168
  • 1
  • 27
  • 27