title: Counting from different categories within the same query
body: <p>I am trying to make a query from a table in Access that would give me totals for different types of product based off of 2 categories, all within one query. For example my Table looks as follows:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Type</th>
  <th>Description 1</th>
  <th>Description 2</th>
  <th>Date</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>New</td>
  <td>Shiny</td>
  <td>Black</td>
  <td>1/1/2022</td>
  </tr>
  <tr>
  <td>New</td>
  <td>Black</td>
  <td>Dull</td>
  <td>1/1/2022</td>
  </tr>
  <tr>
  <td>Old</td>
  <td>Shiny</td>
  <td>Grey</td>
  <td>1/1/2022</td>
  </tr>
  <tr>
  <td>Old</td>
  <td>Grey</td>
  <td>Dull</td>
  <td>1/1/2022</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The query results that I want to receive are as follows:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Description</th>
  <th>New</th>
  <th>Old</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Shiny</td>
  <td>1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>Black</td>
  <td>2</td>
  <td>0</td>
  </tr>
  <tr>
  <td>Dull</td>
  <td>1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>Grey</td>
  <td>0</td>
  <td>2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The dataset that I am working with isn't as clean as my example shown here and is causing some of the issues. I never had an issue with the code running, but I just felt that there had to be an easier way that I was missing.</p>
  <p>They way I was doing it originally just turned into a bunch of separate query's and was messy to get around. I essentially wrote a query to separate the table into new and old types. From there I used a bunch of</p>
  <pre><code>SUM(IIF( Description 1 = &quot;x&quot; OR Description 2 = &quot;x&quot;) AS X
  SUM(IIF( Description 1 = &quot;y&quot; OR Description 2 = &quot;y&quot;) AS Y
  </code></pre>
  <p>expressions to count my totals for each of the objects. This would give me a query where all the totals were displayed in columns. Then I created a separate query to join these data sets together into a presentable manner, but it was turning into too much for how many different &quot;types&quot; I had.</p>
  <p>I was just looking for a way to combine all of this into 1 query that would make pulling reports much easier.</p>