Posted on: 2/14/2014 5:17:37 AM | Views : 681

How to count date difference excluding weekoff  in sql servder. weekoff which is stored in table in below format. Example:
shiftID   weekdayoff
1          Sunday
1          Monday
2          tuesday
2         wednesday
i need difference exclude weekoff for below scenario
01/02/2014 to 11/02/2014 output should be =7.(which is exclude weekoff).
i tried  below one but this is not given exactly.
((DATEDIFF(dd,@Fromdate,@Todate)+1) - COALESCE((SELECT distinct COUNT(weekdayoff)                                        &nb ...

Go to the complete details ...