Help with SQL [message #409168] |
Fri, 19 June 2009 15:33  |
oracle_newbe
Messages: 1 Registered: June 2009
|
Junior Member |
|
|
Hello,
I have a requirment to write a procedure populate calendar table like, year, day, day of the week, month, month end date. I could able to find the queries for the above mentioned coulms. But I am not able to find a sql to identify the following columns. You will understand what am I asking for if you look at the column names. Please look at them and provide me the sql queries.
quarter_time_span,
weekend (0-yes, 1-no),
announced holiday (0-yes, 1-no), (like x-mas, thanks giving..)
quarter_end_date
fiscal year quarter time span,
fiscal year quarter end date
year time span,
year_end_date,
fiscal year_time_span,
fiscal year_end_date
Please make sure I need to add these sql's in my cursor and loop
based on the dates I give. lets say I want to populate the data
for 1 year, I need to get 365 records and date value starts from
'01-jan-2009' to '31-dec-2009'. for every 3 months we needs to
calculate the quarter number, remaining days for the quarter. lets say today is 19 Jun, 2009 its a 2nd quearter. We have to calculate the remainig days (11 days). The date value would become 20 Jun, 2009 when it loops then the remaning days in this quarter should be (10 days). Please help me.
Thanks
[Updated on: Fri, 19 June 2009 15:49] Report message to a moderator
|
|
|
Re: Help with SQL [message #409174 is a reply to message #409168] |
Fri, 19 June 2009 17:02   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
I have worked at a couple of different companies so far, and most of them had different definitions of what those things actually meant.
Where I work now, even inside the same company the definition of "holiday" and "weekend" is different in different locations.
So step one would be to get the definition of those things out of the people in charge.
|
|
|
|