Financail calendar...seed data
Page 1 of 1 • Share •
Financail calendar...seed data
hi
I am tring to write pl/sql procedure to create financial calendar seed date. I have confusion about ... how to code to get financial week /period/start and end date for calendar if financial year and quarter start at first monday of April. any idea or script ?
regards
I am tring to write pl/sql procedure to create financial calendar seed date. I have confusion about ... how to code to get financial week /period/start and end date for calendar if financial year and quarter start at first monday of April. any idea or script ?
regards
GBS74- Posts: 3
Join date: 2009-07-29
Re: Financail calendar...seed data
I worked in a project in big corporation where they were using a fiscal calendar. We calculated the fiscal dates using the Oracle database function "ADD_MONTHS". In that scenario, the fiscal year began on 1st of March. So we had to substract two months to the calendar date to get the fiscal date.
SELECT any_date calendar_date, ADD_MONTHS (any_date, -2) fiscal_date
FROM DUAL
In your scenario, where the fiscal year begins on the first Monday of April the formula will be a little bit different. What I would do is something like this:
1. Calculate the "day_gap" for each year between your fiscal date and the calendar year (depending on the number of years to store, it may be easier to do that manually than finding a formula).
2. Substract the "day_gap" to each date in order to get the fiscal date (e.g. fiscal date 1-Jan-2009 will be the first Monday of April, 2-Jan-2009 the first Tuesday or April and so on).
That should make it. Let me know if you need further help.
Best regards,
SELECT any_date calendar_date, ADD_MONTHS (any_date, -2) fiscal_date
FROM DUAL
In your scenario, where the fiscal year begins on the first Monday of April the formula will be a little bit different. What I would do is something like this:
1. Calculate the "day_gap" for each year between your fiscal date and the calendar year (depending on the number of years to store, it may be easier to do that manually than finding a formula).
2. Substract the "day_gap" to each date in order to get the fiscal date (e.g. fiscal date 1-Jan-2009 will be the first Monday of April, 2-Jan-2009 the first Tuesday or April and so on).
That should make it. Let me know if you need further help.
Best regards,
_________________
Alex Caminals
ClearPeaks
Email: alex.caminals@clearpeaks.com
Mobile: +34 661 422 648
Visit our webpage at: www.clearpeaks.com


alex.caminals@clearpeaks.- Posts: 8
Join date: 2009-02-26
Permissions of this forum:
You cannot reply to topics in this forum





