Hi Chris, I have one query related to above code exactly , I am trying to replicate the same holiday excluding in SQL.

TEST =networkdays('20aug2014'd,''22mar2016'd , "work.holidays","ph")-1;
0 then holidays -1 else 0 - weekends + case when day_of_week(20aug2014) between 2 to 6 then 1 else 0 -1 as test
left join (left join with calendar table to get sum of holidays and sum of weekends )
calendar table (sum(holidays) and sum(weekends) between 20aug2014 and 22mar2016.

I get 402 as test value . Do you have any idea?