My table has sample data and I need to calculate business hrs between two timestamps in two columns. Business hrs : 9:00am to 5:00pm and neglect Saturday and Sunday, I am not co
Use datediff to calculate the diff between the start and the end time and then subtract (date_add with negative hours) the non-working hours: 24 for weekend days, 16 for working days expect the ending and starting day which needs additional calculation. Whether a day is weekend day or not, can be specified with the dayofweek method.