title: Determine/obtain/find management chain (hierarchy) for employees using SQL
body: <p>I have a table (in an MS Access DB) with every employee at a company. The table also has a column to indicate each employee's manager. There are columns (with no data) to indicate that employee's full management chain to the CEO. I need to determine/obtain/find and fill this data using SQL (and/or VBA).</p>
  
  <p>I know what needs to be done but I'm drawing a complete blank on how to do it efficiently.</p>
  
  <p>I know I could go row by row but that seems so inefficient. There has to be a better way.</p>
  
  <p>For example, take this table below:</p>
  
  <pre><code>+------------+-----------+----------+----------+----------+
  | employeeID | managerID | manager1 | manager2 | manager3 |
  +------------+-----------+----------+----------+----------+
  | a          |           |          |          |          |
  | b          | a         |          |          |          |
  | c          | a         |          |          |          |
  | d          | a         |          |          |          |
  | e          | b         |          |          |          |
  | f          | b         |          |          |          |
  | g          | c         |          |          |          |
  | h          | c         |          |          |          |
  | i          | d         |          |          |          |
  | j          | e         |          |          |          |
  | k          | f         |          |          |          |
  | l          | g         |          |          |          |
  +------------+-----------+----------+----------+----------+
  </code></pre>
  
  <ul>
  <li><code>a</code> has no manager (CEO)</li>
  <li><code>b</code>'s manager is <code>a</code></li>
  <li><code>l</code>'s manager is <code>g</code> whose manager is <code>c</code> whose manager is <code>a</code></li>
  <li>etc...</li>
  </ul>
  
  <p>So this would result in the table:</p>
  
  <pre><code>+------------+-----------+----------+----------+----------+
  | employeeID | managerID | manager1 | manager2 | manager3 |
  +------------+-----------+----------+----------+----------+
  | a          |           |          |          |          |
  | b          | a         | a        |          |          |
  | c          | a         | a        |          |          |
  | d          | a         | a        |          |          |
  | e          | b         | a        | b        |          |
  | f          | b         | a        | b        |          |
  | g          | c         | a        | c        |          |
  | h          | c         | a        | c        |          |
  | i          | d         | a        | d        |          |
  | j          | e         | a        | b        | e        |
  | k          | f         | a        | b        | f        |
  | l          | g         | a        | c        | g        |
  +------------+-----------+----------+----------+----------+
  </code></pre>