Next Business day from a date including US Holidays in Oracle SQL - no pl/sql code -
After reading and trying several SQL code, is still facing the problem.
I need to calculate it from the date of 5th business day
I need to remove on 'Saturday' Sunday and the US Holidays
My Have a table with US vacations but my SQL is not able to properly join
BDT WEEKDAY_INDI ---------- ------- ------- 1 6/1/2014 Week ends 2 6/2/2014 Week 3 3/3/2014 WEEKDAY 4 6/4/2014 WEEKDAY 5 6/5/2014 WEEKDAY 6 6/6/2014 WEEKDAY 7 6/7/2014 WEEKEND 8 6/8/2014 End of Week
BUD Like I can get weekly and holidays in a table / different tables
I have a query
from
< / Pre>returns
NAME DOB DOB_MONTH DOJ UPDATED_DATE ---------- ---------------- ------ --- ----------- -------------- 1 Afternoon 9/14/2000 September 2/20/2012 6/12 / 2014 2 Angel 10/9/2000 Oct 5/5/2014 6/10/2014 3 Ashvini 5/17/2000 May 4/6/2011 6/02/2014
I I want to calculate the next business d
UPDATED_DATE
for I included in the holiday table with team table It is a habit of being, but it did not work
Could you please suggest me how to get the next 5th business day (excluding weekends, vacations).
I'm going with you assumption You have a version of the ORCL, in which special form with window equalization methods From LEAD ()
.
time_master
BDATE WEEKDAY_INDI 1 6/1 / 2014 weekend 2 6/2/2014 week 3 3/6/2014 Week 4 6/4/2014 Week 5 6/5/2014 Week 6 6/6/2014 Week of Day 7 6/7/2014 Weekends 8 6/8/2014 WEEKEND
Team
< Code> NAME DOB DOB_MONTH DOJ UPDATED_DATE 1 Afnand 9/14/2000 September 2/20/2012 6/12/2014 2 Angel 10/9/2000 October 5/5/2014 6/10/2014 3 Ashvini 5/17/2000 May 4/6/2011 6/02/2014
The following is something like the SQL Shawl you can start.
SELECT t *, LEAD (tm.BDATE, 5) Over (TIID order by TM. BDT) TeamT Join INNER TIME_master TM on TM .BDATE & gt; = T.UPDATED_DATE and tm.BDATE & lt; Long weekend and TM ViKiADIIIDI = '.UPDATED_DATE + 10 - 10 days
Comments
Post a Comment