Skip to Main Content

SQL & PL/SQL

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.

How to calculate Fiscal year based on date

2823391May 9 2011 — edited Mar 20 2013
HI all,

I have a sql statement which simply queries a single table. The table contains an 'effective date' i.e. to_date('01/09/2010', 'dd/mm/yyyy').

I am creating a view based on this query and want to append a psedo column with the dates fiscal year! the fiscal year we are using is the 01/08/.... tot he 31/07/....

I have been trying a few things and found this example on the net which i have been pkaying with, but am completelty clueless as to where the 83days comes in??

select 'FY'||trunc(trunc(to_date('01/09/2010', 'dd/mm/yyyy') + interval '83' day), 'Y') from dual;

I would be really interested to see how you think this can be done.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 17 2013
Added on May 9 2011
5 comments
21,678 views