Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    84

    Unanswered: Query with totals as the last row?

    Maybe there is a simple solution.

    Is there a possibility to add one row - last row to a query, that will contain sum of some columns?

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi computerforce,

    Look below for one solution. I do that in both the Forms and Reports...however I think you can do it in a query as well.

    have a nice one,
    Bud
    Attached Files Attached Files

  3. #3
    Join Date
    Mar 2004
    Posts
    84
    Thanks Bud,
    This solution is for possibility when Sum is used in Forms and Reports. Last two days I made a possible solution - query with its totals in its last row.

    Main query would be based on - for example - two tables.
    Then totals query with only one row - sum.
    And union query - union based on those two queries (just number of fields in the union - third query must be the same for both first and second query).
    Everything seems to work good. If you are interested I can make some example and attach it to reply.

    Everything Best!

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Quote Originally Posted by computerforce
    Thanks Bud,
    This solution is for possibility when Sum is used in Forms and Reports. Last two days I made a possible solution - query with its totals in its last row.

    Main query would be based on - for example - two tables.
    Then totals query with only one row - sum.
    And union query - union based on those two queries (just number of fields in the union - third query must be the same for both first and second query).
    Everything seems to work good. If you are interested I can make some example and attach it to reply.

    Everything Best!

    Why would you need to do that?

    Just curious.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Mar 2004
    Posts
    84
    Why:

    If you want to put query to internet, without any modifications, this query woud be final query for publishing - it has its totals. One table at website page would be just filled with query data.

  6. #6
    Join Date
    Mar 2004
    Posts
    84
    Teddy, do you have a better solution?

    To have something like:

    product1 10 3 30
    product2 20 2 40
    product3 50 1 50
    total 120 //calculated

    first three rows - from one query, fourth from second query (total), and third - union query made from first two queries.

Posting Permissions

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