For more information, please refer to this announcement explaining best practices for getting answers to questions.
Hours between dates excluding weekend
So I have found the formula here and on MOS for calculating the days between dates and excluding Sat/Sun. But our SLA's are 24 or 48 hours for some tasks so I want the hours because 1 for days doesn't tell us any thing.
Is there a way to change this formula to count hours that are not Saturday or Sunday between dates?
CASE WHEN DAYOFWEEK("start_date") > DAYOFWEEK("end_date")
THEN CASE WHEN DAYOFWEEK("start_date") = 7
THEN TIMESTAMPDIFF(SQL_TSI_DAY, "start_date", "end_date") - (Floor(TIMESTAMPDIFF(SQL_TSI_DAY, "start_date", "end_date")/7)*2)-1
ELSE TIMESTAMPDIFF(SQL_TSI_DAY, "start_date", "end_date") - (Floor(TIMESTAMPDIFF(SQL_TSI_DAY, "start_date", "end_date")/7)*2)-2 END