How can I calculate the time between two timestamps in MS SQL Server excluding any weekends?
For example, from 2013-05-03 17:00:00 to 2013-05-06 09:00:00 should give me 16 hours.
(Better if it's a function which I can call fn(hours, stdt, enddt)
.)