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

MySQLMySQLi Database

<p>With the help of DATEDIFF(expr1, expr2) we can find the business days between two specified dates.</p><p style="">For example, if we want to find business days between &lsquo;2017-05-27&rsquo; and &lsquo;2017-05-23&rsquo; then following would be MySQL query &minus;</p><pre class="prettyprint notranslate">mysql&gt; Select DATEDIFF(&#39;2017-05-27&#39;,&#39;2017-05-23&#39;) AS &#39;Total Business Days&#39;; +----------------------+ | Total Business Days &nbsp;| +----------------------+ | 4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| +----------------------+ 1 row in set (0.00 sec)</pre>
raja
Updated on 28-Jan-2020 10:00:44

Advertisements