Hello,I want to get a total amount of hours for a date range, but I want to exclude any weekend hours from this? So, I want to do it all on one select statement as shown below. I'm stuck on the part of how to get only the weekend hours for the date range so I can subtract it from the datediff function. I have looked online, but nothing works. Any help is appreciated. Thanks.declare @startdate datetime, @enddate datetimeset @startdate = '1/1/2016'set @enddate = 1/30/206'select datediff(hh, @startdate, @enddate) - (only weekend hours here)from table1
↧