SSRS 2008 Datediff for Working Days

datediff, ssrs-2008

Solution

The SQL in the link (Number of working days between two dates) translated for SSRS: Hopefully this will give you a good place to start. Type this into the expression for the textbox.

=(DateDiff(DateInterval.day,Parameters!STARTDATE.Value,Parameters!ENDDATE.Value)+1)
-(DateDiff(DateInterval.WeekOfYear,Parameters!STARTDATE.Value,Parameters!ENDDATE.Value)*2)
-(iif(Weekday(Parameters!STARTDATE.Value) = 7,1,0)
-(iif(Weekday(Parameters!ENDDATE.Value) = 6,1,0))-1)

Problem

I have seen this question asked a lot and I cannot seem to find one clear answer about "how to calculate business days only between two dates?" The expression below will give me the total days but I am looking to exclude Saturday and Sunday. ``` =DateDiff("d",Parameters!STARTDATE.Value,Parameters!ENDDATE.Value) ``` I would appreciate specific help about how to accomplish this. Thank you in advance.

Original source