title: Sum in Access Producing Total Sum and Placing This on Each Row
body: <p>I am trying to create two columns: IntlAir and DomesticAir. I have a Boolean column in my data called <code>International</code>, and IntlAir returns <code>Penalty + SellingFare</code> when <code>International</code> is <code>TRUE</code>, and DomAir returns that sum when <code>International = FALSE</code>.</p>
  
  <p>I would like to show this amount for each DK by Month.</p>
  
  <p>My code is:</p>
  
  <pre><code>SELECT data.PostingMonth, data.DK_Number
       , (SELECT sum(data.Penalty + data.SellingFare)
          FROM data
          WHERE data.International = TRUE) AS IntlAir
       , (SELECT sum(data.Penalty + data.SellingFare)
          FROM data
          WHERE data.International = FALSE) AS DomesticAir
  FROM data
  GROUP BY data.PostingMonth, data.DK_Number
  ORDER BY data.PostingMonth;
  </code></pre>
  
  <p>However, the output is giving me the total sum across all dks and across all months, and putting this value into every row.</p>
  
  <p>Can someone tell me what I am doing wrong?</p>