Home  >  Article  >  Database  >  In MySQL, how to find the working days between two specified dates?

In MySQL, how to find the working days between two specified dates?

王林
王林forward
2023-08-24 20:25:051371browse

In MySQL, how to find the working days between two specified dates?

Using the DATEDIFF(expr1, expr2) function, we can find the working days between two specified dates.

For example, if we want to find the working days between '2017-05-27' and '2017-05-23', then the following is the 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)

The above is the detailed content of In MySQL, how to find the working days between two specified dates?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete