title: Employee Schedules for the next 2 weeks
body: <p>Im currently working on a couple of MySQL events to publish employee schedules for the next 14 days.</p>
  <p>Every employee has a set schedule every day. I currently have a table that contains the scheudles but instead of having the date, it has the day name. Here is an example of the table:</p>
  <pre><code>| ID |  EmpID   |   LOB  |    DOW    |   event  | StartAt   |    EndAt |
  ------------------------------------------------------------------------
  | 1  |Z.Mora3847|  FNOL  |   Monday  |   Shift  |   9:00    |   17:30  |
  | 2  |Z.Mora3847|  FNOL  |   Tuesday |   Shift  |   9:00    |   17:30  |
  | 3  |Z.Mora3847|  FNOL  |  Wednesday|   Shift  |   9:00    |   17:30  |
  </code></pre>
  <p>I have to find a way to generate the next 2 week schedules for each employee based on the day of the week from this table and store it into a similar table where instead of having the column &quot;dow&quot; we have a column called &quot;date&quot; and it must contain the future date matching the dayname from the first table.</p>
  <p>If I try this, it returns me the expected value for one day:</p>
  <pre><code>select SB.EmpID, SB.lob, dow, date_add(curdate(),interval 1 day) as Date, SB.StartAt, SB.EndAt from SandBox.ScheduleBase as SB where dayname(date_add(curdate(), interval 1 day)) = dow
  </code></pre>
  <p>and this is the output:</p>
  <pre><code>| ID |  EmpID   | LOB  |  DOW      |  Date      | StartAt   |    EndAt |
  ------------------------------------------------------------------------
  | 1  |Z.Mora3847|FNOL  | Saturday  | 2021-04-17 |   9:00    |   17:30  |
  </code></pre>
  <p>And I want to be able to do this for the next 14 days.</p>
  <p>Im using 5.5.68-MariaDB</p>
  <p>I hope you guys can help me with this one.</p>