title: Merging of multiple tables with Microsoft Access
body: <p>On work, I have a problem with merging multiple tables into one table with Microsoft Access. So what I have is one Microsoft Access DB-file with multiple tables.</p>
  
  <p>We can assume that each table only consists out of two columns. CustomerID and numb_of_purchases. I have one table for each month and want to merge all those tables in one big table, so for example for two months:</p>
  
  <pre><code>TableJan
      Customer_ID  numb_of_purchases_Jan
      1                     10
      2                     53
      3                     98
      4                     101
  </code></pre>
  
  <p>and</p>
  
  <pre><code>TableFeb
      Customer_ID  numb_of_purchases_Feb
      3                     86
      5                     5
  </code></pre>
  
  <p>are supposed to be merged into a bigger table, which looks like:</p>
  
  <pre><code>  Customer_ID  numb_of_purchases_Jan  numb_of_Purchases_Feb
      1                     10                   0
      2                     53                   0
      3                     98                   86
      4                     101                  0
      5                     0                    5
  </code></pre>
  
  <hr>
  
  <p>how would you solve such a problem? At first I thought it would be very easy by, for example, using the UNION function, so I tried to write the following query:</p>
  
  <pre><code>SELECT TableJan.Customer_ID, numb_of_purchases_Jan
  FROM Table_Jan
  
  UNION
  
  SELECT TableFeb.Customer_ID, numb_of_purchases_Feb
  FROM Table_Feb;
  </code></pre>
  
  <p>Executing this query was something along these lines:</p>
  
  <pre><code>Customer_ID  numb_of_purchases_Jan
  1                     10
  1                     0
  2                     53
  2                     0
  3                     98
  3                     86
  4                     101
  4                     0
  5                     5
  </code></pre>
  
  <p>So essentially, I am missing an entire column compared to the desired output and instead the values of numb_of_purchases_Feb are stored in the numb_of_purchases_Jan-column.</p>
  
  <p>I would greatly appreciate if someone could point out any mistakes in my UNION-command or have an other, maybe more simpler solution to the given problem.</p>