Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    7

    Unanswered: Cumulative total for columns in select query

    Hello:

    I putting together a select query and the results look like this:

    Month Unredeemed Total Sales

    200501 50 100
    200502 200 550
    200503 25 125

    I would like to have two more columns to the right that are cumulative totals of the "Unredeemed" and "Total Sales" columns. It would look like this:

    Month Unredeemed Total Sales Cum. Unredeemed Cum.Total Sales

    200501 50 100 50 100
    200502 200 550 250 650
    200503 25 125 275 775

    Is there an expression or function I can use to accomplish this? Thanks for your help.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Any number of ways, a couple here:

    http://support.microsoft.com/default...b;en-us;208714

    If this is for a report, it may be easier to use the Running Sum property of a textbox.
    Paul

  3. #3
    Join Date
    Sep 2005
    Posts
    7
    Thanks. Can you divide two running sums in a report to find a percentage? I doesn't seem to work when I try it. Thanks.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Probably depends on the specifics, but I just did a quick test and it worked fine. Post your SQL.
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •