title: Find status from separate fact table
body: <p>This is in snowflake, but I can figure out any other syntax that is similar.
  I have a table of employees and the date they received a paycheck</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>EMP_ID</th>
  <th>Check_dt</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>10-7-2021</td>
  </tr>
  <tr>
  <td>2</td>
  <td>9-28-2021</td>
  </tr>
  <tr>
  <td>1</td>
  <td>3-1-2021</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>And a table that has employee history for full/part time status changes, and the date the change was made effective</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>EMP_ID</th>
  <th>Status</th>
  <th>Effective Date</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>F</td>
  <td>1/1/20201</td>
  </tr>
  <tr>
  <td>2</td>
  <td>P</td>
  <td>1/1/2021</td>
  </tr>
  <tr>
  <td>1</td>
  <td>P</td>
  <td>6/1/2021</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>(In this example, employee 1 changed from full to part time halfway through the year)</p>
  <p>I want to get the status (F/P) of the employee at the time they received their paycheck.</p>
  <p>The output I want is:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>EMP_ID</th>
  <th>Check_dt</th>
  <th>Status</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>10-7-2021</td>
  <td>P</td>
  </tr>
  <tr>
  <td>2</td>
  <td>9-28-2021</td>
  <td>P</td>
  </tr>
  <tr>
  <td>1</td>
  <td>3-1-2021</td>
  <td>F</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Thanks in advance!</p>