473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

To find a cut off date based on the working days setup

My question is how do I manipulate the procedure to calculate cut-off date with in working days and it should skip weekends and holidays?

I have holiday table to determine holidays
Table Name : HOLIDAYMSTR
HOLIDAYMSTR_ID RAW(16)
PREV_UPDATED_BY RAW(16) Y
LAST_UPDATED_BY RAW(16)
HOLIDAY_DATE DATE
EFFECTIVE_DATE DATE
EXPIRY_DATE DATE Y
PREV_UPDATED_DATETIME DATE Y
LAST_UPDATED_DATETIME DATE SYSDATE
DEFUNCT_IND CHAR(1) 'N'
COUNTRY_CODE VARCHAR2(10) Y
HOLIDAY_DESC VARCHAR2(100)
HOLIDAY_DESC_LANG1 VARCHAR2(100) Y
HOLIDAY_DESC_LANG2 VARCHAR2(100) Y
HOLIDAY_DESC_LANG3 VARCHAR2(100) Y


For example:

If the date is 01/01/2007 and the resulting date should be return 02/01/2007.


procedure get_LastCutOffDt(v_date_fr in date,
v_date_rtn out date,
v_Error_rec out AHH.AHH_ERRLOG_MSG%rowtype)
is
v_days_rtn varchar2(15);
begin
--logic to get last cut off date based on the working days setup


v_error_rec.error_code := 0;
v_error_rec.error_text := '';
return;

exception
when others then
rollback;
v_error_rec.error_code := 9999;
v_error_rec.error_text := substr(sqlerrm,1,100);
dbms_output.put_line('0.1 '||v_error_rec.error_text);
ahh_pkg_error.ins_ERRMSG_LOG(v_error_rec);
return;
end get_LastCutOffDt;

The logic should check holidays and weekends and produced the last cut-off date. I shall be very greatful, if you could kindly help on this.
Jan 10 '07 #1
0 1508

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
3
by: Shevek | last post by:
Hi All, Hope someone can help! I am building an Event Calendar app based around the Calendar WebControl which builds an SQL string based on the SelectedDates property which is passed to...
1
by: Wayne | last post by:
Hi all I'm trying to calculate the number of days (or workdays) between 2 given dates that do not include weekend days or public holidays (public holidays are user defined from a dbase, have a...
29
by: james | last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old database file that has the date(s) stored in it as number of days. An...
2
by: semedao | last post by:
Hi All, I developed Outlook add-in with VS 2005 , everything work fine , until the machine reboot unnormally , when I opened the solution again many projects was not there ! (I have more then...
9
by: ice | last post by:
Hello, I have a couple of tables. The client tables and the contacted tables. I am not sure how to start on this, what I need is a way to query all my clients then show any client that the...
7
by: =?Utf-8?B?U3R1?= | last post by:
I have a ASP.NET Ajax app (using client library) calling ASP.NET Ajax-enabled web services. We are making use of the javascript proxies generated by ASP.NET Ajax. The problem we have is that the...
5
FOE2272
by: FOE2272 | last post by:
I am working on a report that will Sum the Sales (Bid Price Field) that are still Active (Bid Status Field) for the past 1 Week, 2 Weeks, 3 Weeks, 4 Weeks, 30 Days, 60 Days, 90 Days, 120...
3
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.