title: Access 2007 Crosstab Query Expression
body: <p>Goal: to create a percentage column based off the values of calculated columns.</p>
  
  <p>Here's the SQL code of the Crosstab query:</p>
  
  <pre><code>TRANSFORM Count(Master_Calendar.ID) AS CountOfID
  SELECT Master_Calendar.Analyst, Count(Master_Calendar.ID) AS [Total Of ID]
  FROM Master_Calendar
  GROUP BY Master_Calendar.Analyst
  PIVOT Master_Calendar.[Current Status];
  </code></pre>
  
  <p>This gives me a crosstab query that displays the amount of entries in the database that are "Completed", "In Process", or "Not Started", sorted by which Analyst they belong to.</p>
  
  <p>What I'm trying to do is add another column to calculate the Percent Complete -- so (Completed / Total of ID) * 100. I tried putting that into an expression in another cell, but it returns with a "[Completed]" not found, even though it gives me it as an option in the Expression Builder.</p>
  
  <p>Am I just naming my variables wrong, or is it not possible to do it this way? Can I reference the total count of the records that contain "Completed" using query code instead of finding out the value using a Pivot table?</p>
  
  <p>Thanks for your help.</p>