Try this formula for working days (1-5) in daysThe difference in Weeks times the working days in a weeks minus the difference between the day of the week of the first date and the second onedatediff(week,@date1,@date2) * 5 - datepart(dw,@date1) + datepart(dw,@date2)
I did some tests and I think is correct--testprint datediff(week,'11/5/2004','11/11/2004') * 5 - datepart(dw,'11/5/2004') + datepart(dw,'11/11/2004')print datediff(week,'11/2/2004','11/10/2004') * 5 - datepart(dw,'11/2/2004') + datepart(dw,'11/10/2004')print datediff(week,'11/4/2004','11/16/2004') * 5 - datepart(dw,'11/4/2004') + datepart(dw,'11/16/2004')print datediff(week,'11/1/2004','11/18/2004') * 5 - datepart(dw,'11/1/2004') + datepart(dw,'11/18/2004')print datediff(week,'11/5/2004','11/8/2004') * 5 - datepart(dw,'11/5/2004') + datepart(dw,'11/8/2004')
*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*A candle loses nothing by lighting another candle