title: ConcatRelated Function Returns All Values
body: <p>Using Allen Browne's ConcatRelated function is not returning correctly.</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>OrderNumber Product Types
  00054001021 ROUND
  00054001021 WHITE
  00054001121 CONCAVE
  00054001121 SCORED
  00054001121 WHITE
  00054001221 CAPSULE
  00054001221 SCORED
  00054001221 WHITE
  </code></pre>
  
  <p>Using this:</p>
  
  <pre><code>SELECT DISTINCT YourTable2.OrderNumber, ConcatRelated("[Product Types]","YourTable2","[OrderNumber]="&amp; "[OrderNumber]","[Product Types]",",") AS All_Product_Types
  FROM YourTable2;
  </code></pre>
  
  <p>Is returning all of the ProductTypes for each Order Number:</p>
  
  <pre><code>OrderNumber All_Product_Types
  00054001021 CAPSULE,CONCAVE,ROUND,SCORED,SCORED,WHITE,WHITE,WHITE
  00054001121 CAPSULE,CONCAVE,ROUND,SCORED,SCORED,WHITE,WHITE,WHITE
  00054001221 CAPSULE,CONCAVE,ROUND,SCORED,SCORED,WHITE,WHITE,WHITE
  </code></pre>
  
  <p>It should be:</p>
  
  <pre><code>OrderNumber     All_Product_Types
  00054001021     ROUND, WHITE
  00054001121     CONCAVE, SCORED, WHITE
  00054001221     CAPSULE, SCORED, WHITE
  </code></pre>
  
  <p>What am I doing wrong?</p>