I need a SQL function that will calculate the elapsed time between two datetime values. Also, I need to exclude saturdays and sundays and if possible, only include the times that are within the normal hours of operation( 8am-5pm). The need output has to be split into days, hours, and minutes. ex. Days 5 : Hours 13 : Minutes 30. Is this possible in SQL Server? I know there is a similar function in Excel. Thanks.