title: Is there a way to sum the rows above the current row
body: <p>I am trying to replicate a spreadsheet into a database and I am stumped on how to only sum the rows above the current row like I can do in excel. For example, the formula for the one column is as follows:</p>
  
  <pre><code>=SUM($B$9:$B9)/SUM($E$9:$E9)
  =SUM($B$9:$B10)/SUM($E$9:$E10)
  =SUM($B$9:$B11)/SUM($E$9:$E11) 
  </code></pre>
  
  <p>.... and so on.</p>
  
  <p>I need to somehow reproduce this formula in my select qry but not sure how?</p>
  
  <pre><code>SELECT Column1,Column2, SUM(Column1) + SUM(Column2) as Expr1
  From tblTest
  Group By Column1,Column2
  </code></pre>
  
  <p>Any ideas?</p>
  
  <pre><code>    Col1    Col2    Col3  Total     Col1/Total      Trying to get this               
      7       0       3     10         70.00%          70.00%
      1       0       1                100.00%         72.73%
      2       0       4     6          33.33%          58.82%
      3       1       1     5          60.00%          59.09%
  </code></pre>