title: SQL statement to generate a table of totals by month
body: <p>I am very unfamiliar with advanced SQL.
  Lets say I have the following table (in Access - using Jet 4.0 OLEDBAdapter in VB.NET).</p>
  
  <p>Table - Items</p>
  
  <pre><code>ID     Date      Account  Amount
  -----  ------    -------  ------
  1      1/1/2013  Cash     10.00
  2      2/1/2013  Cash     20.00
  3      1/2/2013  Cash     30.00
  4      2/2/2013  Cash     40.00
  5      1/1/2013  Card     50.00
  6      2/1/2013  Card     60.00
  7      1/2/2013  Card     70.00
  8      2/2/2013  Card     80.00
  </code></pre>
  
  <p>And I want to generate the following - totals for each account per month</p>
  
  <p>Table - Totals</p>
  
  <pre><code>Account  Jan       Feb
  -----    -----     ------
  Cash     30.00     70.00
  Card     110.00    150.00
  </code></pre>
  
  <p>Is this possible using one SQL statement. I can do it in two but it is very slow.</p>
  
  <p>Edit - the closest I have got is this - but it doesn't generate columns</p>
  
  <pre><code>SELECT    accFrom, Sum(amount) 
  FROM      Items
  WHERE     Year(idate) = '2012' 
  GROUP BY  Month(idate), accFrom
  </code></pre>