Hi
How can I calculate the days between 2 dates not including Holidays? (I have calculated the labor days but they include holidays).
I have a table like this :
RQ - Start_Date -End_Date
A - 01/01/2015 01/01/2016
B - 08/07/2015 01/01/2016
And another query with holidays:
ID Date
1 - 25/12/2015
2- 01/01/2016
.
.
.
The best way is to add an attribute to your date dimension table (you do have one, right?) that indicates if it is a holiday.
But if you cannot do that, left outer join the two tables based on date, and only include those that have a null for the holiday side of the join.
Hi bdbits
My table :
ID - Date
1 24/12/2015
2 01/01/2016
etc
It is for holidays. So there are only the holidays. Should I add all the days?
But then on my 2nd table I have
RQ - Start_Date -End_Date
A - 01/01/2015 01/01/2016
B - 08/07/2015 01/01/2016
And I want to calculate the holidays between start_date and end_date on each row.Like this :
RQ - Start_Date -End_Date Holidays
A - 01/01/2015 01/01/2016 1
B - 08/07/2015 01/01/2016 2
Can this be possible?
This thread might be useful:
http://www.cognoise.com/index.php/topic,28179.msg91275.html#msg91275
Good one Lynn. I never remember to search the forum for past discussions. :o
The way the guy did it (last post) is pretty much what I had in mind when I lightly tossed out the suggestion to add it to the date table.