Here's the custom function to find the number of days between two dates excluding weekends.
It uses Data Services's built-in-function day_in_week().
$L_Start and $L_End are the two input dates
Here's the custom function to find the number of days between two dates excluding weekends.
It uses Data Services's built-in-function day_in_week().
$L_Start and $L_End are the two input dates
$L_Diff = day_in_week($L_End) - day_in_week($L_Start) ;
$L_Output = ((date_diff( $L_End,$L_Start,'D')- $L_Diff) / 7 * 5) + (decode(($L_Diff <5) ,$L_Diff,5))-
decode ( day_in_week($L_End)-4> 0 , day_in_week($L_End)-4 ,0)%5;
return($L_Output);