title: Can I force row headers to show on an Access crosstab with dynamic column headers?
body: <p>I have tblOuts that tracks Skus out of inventory by Category and date:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>OutDate</th>
  <th>Category</th>
  <th>Sku</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>20210322</td>
  <td>A</td>
  <td>111</td>
  </tr>
  <tr>
  <td>20210322</td>
  <td>B</td>
  <td>222</td>
  </tr>
  <tr>
  <td>20210323</td>
  <td>A</td>
  <td>111</td>
  </tr>
  <tr>
  <td>20210323</td>
  <td>B</td>
  <td>222</td>
  </tr>
  <tr>
  <td>20210323</td>
  <td>B</td>
  <td>333</td>
  </tr>
  <tr>
  <td>20210324</td>
  <td>D</td>
  <td>444</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I created a crosstab that will show the count of Skus by Category and OutDate:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Category</th>
  <th>20210322</th>
  <th>20210323</th>
  <th>20210324</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>1</td>
  <td>1</td>
  <td></td>
  </tr>
  <tr>
  <td>B</td>
  <td>1</td>
  <td>2</td>
  <td></td>
  </tr>
  <tr>
  <td>D</td>
  <td></td>
  <td></td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p><strong>How can I modify the crosstab to also show Category C, even though it doesn't have any data in my table yet?</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Category</th>
  <th>20210322</th>
  <th>20210323</th>
  <th>20210324</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>1</td>
  <td>1</td>
  <td></td>
  </tr>
  <tr>
  <td>B</td>
  <td>1</td>
  <td>2</td>
  <td></td>
  </tr>
  <tr>
  <td>C</td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>D</td>
  <td></td>
  <td></td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Normally I would create a separate table that listed all Categories and left join it to the crosstab.  But I can't think of an ideal way to do so.</p>
  <pre><code>SELECT tblCategories.Category, qryCrosstab.*
  FROM tblCategories LEFT JOIN qryCrosstab ON tblCategories.Category = qryCrosstab.Category
  </code></pre>
  <p>gives me two Category fields, which I don't want:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>tblCategories.Category</th>
  <th>qryCrosstab.Category</th>
  <th>20210322</th>
  <th>20210323</th>
  <th>20210324</th>
  </tr>
  </thead>
  </table>
  </div>
  <p>Alternately, I could do the following, but would need to modify my query every time a new date is added to the table:</p>
  <pre><code>SELECT tblCategories.Category, qryCrosstab.20210322, qryCrosstab.20210323, qryCrosstab.20210324
  FROM tblCategories LEFT JOIN qryCrosstab ON tblCategories.Category = qryCrosstab.Category
  </code></pre>