title: How to count "Sunday" of the month to count absent employees
body: <p>I have a problem calculating employee absenteeism in a month. In my query it still counts the day of the 'sunday' in this month, which shouldn't count.</p>
  <p>This is an sample database used :</p>
  <p>emp0003 table's</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">NIK</th>
  <th style="text-align: center;">Name</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">Susan</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>dvc0004 table's</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">NIK</th>
  <th style="text-align: center;">Enroll</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-08 07:20:39</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-06 14:37:08</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-06 07:57:42</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-05 17:29:00</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-05 08:09:54</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-04 19:21:38</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-04 08:12:44</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-03 17:44:02</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-03 08:06:27</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-02 18:52:15</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-02 08:02:32</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-01 20:07:13</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-02-01 07:55:49</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-01-30 16:20:56</td>
  </tr>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">2021-01-30 07:59:45</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>this is my query sql:</p>
  <pre><code>SELECT
      emp0003.NIK,
      emp0003.`Name`,
      DAY(CURRENT_DATE) - COUNT(
          DISTINCT
          DATE(LEFT((`dvc0004`.`Enroll`), 10)),
          (CASE
              WHEN LEFT(( `dvc0004`.`Enroll`), 10) 
                  AND MONTH(LEFT((`dvc0004`.`Enroll`), 10)) = MONTH(CURRENT_DATE()) 
                  AND YEAR(LEFT((`dvc0004`.`Enroll`), 10)) = YEAR(CURRENT_DATE())
              THEN 1 
          END)
      ) AS 'TOTAL ABSENT OF THE MONTH'            
  FROM emp0003
  LEFT JOIN dvc0004 ON emp0003.NIK = dvc0004.NIK      
  WHERE emp0003.nik = '01190301' 
  </code></pre>
  <p>this is result for my query sql :</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">NIK</th>
  <th style="text-align: center;">Name</th>
  <th style="text-align: center;">TOTAL ABSENT OF THE MONTH</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">Susan</td>
  <td style="text-align: center;">1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>should be the result:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">NIK</th>
  <th style="text-align: center;">Name</th>
  <th style="text-align: center;">TOTAL ABSENT OF THE MONTH</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">01190301</td>
  <td style="text-align: center;">Susan</td>
  <td style="text-align: center;">0</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>because so far it has only passed one 'sunday' this month</p>