title: How to get cumulative total for previous month and upto this month?
body: <pre><code>ID  pcID    contractor  approver    claimed
  -------------------------------------------
  1   1       one          1000         900
  2   1       two          200          100
  3   1       three        1000        1000
  4   1       six          100          11
  5   2       six          100          22
  6   3       six          120           1
  7   4       three        102          10
  </code></pre>
  <p>From the above table, I need to get cumulative amount for upto this month and previous month of approver and claimed and also current month approver, claimed amount based on the contractor. Like below table.</p>
  <pre><code>ID  contractor  approver    claimed  uptothisMTApprover   uptothisMTClaimed  previousMTApprover previousMTClaimed 
  -----------------------------------------------------------------------------------------------------------------
  1    one          1000       900     1000                 900                0                   0
  2    two          200        100     200                  100                0                   0
  3    three        102        10      1102                 1010               1000                1000
  4    six          120        1       320                  34                 200                 33
  </code></pre>
  <p>Thanks in advance..</p>