Skip to content
Advertisement

Year, Next Year, Quarter e Next Quarter based in a FISCAL YEAR

I need to bring the results of this SQL showing all the data of “MY FISCAL YEAR” that started in 1st june, and other SQL to showing all the data of the “NEXT FISCAL YEAR”, because I made it based on the database calendar.

btw, the last fiscal year ended in 31 MAY

The user will sent the request with the sysdate by an API request. For example, if a user sent a request in october 2022 the result of my SQL need to be all projects of my fiscal year (2022-2023) as I said that started 1st june.

My SQL is returning all projects in 2022 based on the database calendar

YEAR 2022

This is my SQL that showing all projects in 2023 based on the database calendar, but as I said, in this SQL, I need all the projects of my Next Fiscal Year 2023-2024

NEXT YEAR 2023

In the same way, I will need the ACTUAL QUARTER and the NEXT QUARTER based on my FISCAL YEAR that I mentioned. because I did it based on the database quarter. and the database quarter now is Q2. But in my calendar fiscal year need to be Q1 to show the result from June.

QUARTER BASED ON THE DATABASE CALENDAR

The next quarter base on the data base calendar

THE NEXT QUARTER BASED ON THE DATABASE CALENDAR

Please guys, anyone can help me ?

Thank you very much.

Advertisement

Answer

This fiscal year (2022-06-01 – 2023-05-30):

Next fiscal year (2023-06-01 – 2024-05-30):

Current quarter (2022-06-01 – 2022-08-31 – 2022Q1):

Next quarter (2022-09-01 – 2022-11-30 – 2022Q2):

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement