1

I'm using this query to calculate the difference between two days:

SelectnCONCAT(

TIMESTAMPDIFF(day,c.created_at,ADDTIME(m.updated_at,'-5:00:00')) , ' days ',

MOD( TIMESTAMPDIFF(hour,c.created_at,ADDTIME(m.updated_at,'-5:00:00')), 24), ' hours ',

MOD( TIMESTAMPDIFF(minute,c.created_at,ADDTIME(m.updated_at,'-5:00:00')), 60), ' minutes '

) as 'Cycle time',

This works fine but it's including weekdays in between two days. Can you please help me with how to exclude weekend days from calculation.

Example:

If calculation return 5 days as cycle time and 2 of these days were weekend days, I want the calculation to return 3 days.

Thanks!!!

Lelio Faieta
  • 6,457
  • 7
  • 40
  • 74
Marko
  • 31
  • 4

0 Answers0