What is the way to find business days between two specified dates in MySQL?

MySQLMySQLi Database

With the help of DATEDIFF(expr1, expr2) we can find the business days between two specified dates.

For example, if we want to find business days between ‘2017-05-27’ and ‘2017-05-23’ then following would be MySQL query −

mysql> Select DATEDIFF('2017-05-27','2017-05-23') AS 'Total Business Days';
+----------------------+
| Total Business Days  |
+----------------------+
| 4                    |
+----------------------+
1 row in set (0.00 sec)
raja
Published on 19-Feb-2018 06:39:01
Advertisements