title: Count unique values grouped by name in MS Access
body: <p>The answer to exercise #3 at <a href="http://www.techonthenet.com/sql/count.php" rel="nofollow noreferrer">tech on the net</a> is exactly what I need.  However through my own experience and <a href="https://stackoverflow.com/questions/11880199/how-do-i-count-unique-items-in-field-in-access-query">Jensen's answer to a similar question</a> I've found that it doesn't work.</p>
  
  <p>I have data that looks like this:</p>
  
  <pre><code>my_table:
  : Customer : Contract : Product : Date    :
  : John     : 123      : Plate   : 12/5/13 :
  : John     : 123      : Spork   : 12/5/13 :
  : Jane     : 567      : Bowl    : 9/9/13  :
  : Jane     : 789      : Plate   : 9/9/13  :
  : Jane     : 789      : Spork   : 9/9/13  :
  : Bob      : 234      : Plate   : 8/7/13  :
  : John     : 345      : Plate   : 4/9/13  :
  : John     : 345      : Sponge  : 4/9/13  :
  </code></pre>
  
  <p>What I want is to get the number of unique contracts for each customer.</p>
  
  <pre><code>my_query
  : Customer : Number of Contracts :
  : Jane     : 2                   :
  : John     : 2                   :
  : Bob      : 1                   :
  </code></pre>
  
  <p>If I wanted just the contracts from June 2013 to June 2014, (past year), then I would get:</p>
  
  <pre><code>my_query
  : Customer : Number of Contracts :
  : Jane     : 2                   :
  : Bob      : 1                   :
  : John     : 1                   :
  </code></pre>
  
  <p>Thanks in advance!</p>