Results 1 to 4 of 4
  1. #1
    summerAIS is offline Novice
    Windows Vista Access 2000
    Join Date
    Jul 2010
    Posts
    2

    combine rows

    Hello everyone! First post here. I'm and accounting major and I'm taking an accounting information systems class (AIS) this summer. We have to solve some MS Access problems. I'm still kind of a newbie with Access and my prof is one of those types that won't help anyone, expects us to be experts already, and is pretty much useless, and is just there to collect a paycheck and needs to be fired. (can you say "tenure"?...LOL).



    I've also taken a few Java programming classes, and some DB classes using SQL and Oracle. However, that was last year, and I have forgotten most of it already since I have not used it everyday. In addition, the prof for this class has us using a textbook that uses MS Access 2000 (I know, a little "outdated"), and everything I have done in the past has been with much more current software. It uses VBA, which I am not familiar with at all.

    I am having trouble with what would probably seem like a very basic problem to most of you.

    So, here it is:
    I need to calculate the total purchases for each item, and the total for all purchases. I have managed to get the output I want, but I need to get the "InventoryID" column to have no repeating rows. Is there a way to combine the "KC0000" and the "IM0000" which each show up twice in so that they each only show up on one row, and their totals (for quantity and cost) are added together?

    I was thinking I might need a second query based on the first one. What do you think? Or can I modify the design view query to do just as I need?

    I can probably figure this out in an SQL statement, but again, I have to use MS Access 2000 for this which is set up for VBA.

    In SQL, I would probably use DISTINCT which would read something like:

    SELECT DISTINCT InventoryID
    FROM Inventory Table

    (And include the rest of the statements in the query to get the results I need, which I can't think of off the top of my head)

    But is there a way to do this using the Query Builder in design view?

    I have included a couple screenshots.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    In that second query, change the "Group By" on the columns you want totaled to "Sum". See if that gets what you want. The only Group By should be on your InventoryID field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    summerAIS is offline Novice
    Windows Vista Access 2000
    Join Date
    Jul 2010
    Posts
    2

    That did the trick!

    Quote Originally Posted by pbaldy View Post
    In that second query, change the "Group By" on the columns you want totaled to "Sum". See if that gets what you want. The only Group By should be on your InventoryID field.
    That did the trick! It is exactly what needed. Thanks a million pbaldy.

    Now I can move on to some harder probs!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    No problemo, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combine 3 Queries
    By Logix in forum Queries
    Replies: 1
    Last Post: 06-10-2010, 06:03 PM
  2. Combine queries
    By thart21 in forum Queries
    Replies: 1
    Last Post: 03-05-2010, 01:39 PM
  3. Combine fields into one
    By cotri in forum Forms
    Replies: 2
    Last Post: 03-04-2010, 02:42 PM
  4. Combine multiple rows into one cell
    By zarfx4 in forum Queries
    Replies: 8
    Last Post: 06-08-2009, 10:42 AM
  5. I have 4 Tables in Access - can I combine them?
    By officespace in forum Access
    Replies: 6
    Last Post: 02-22-2009, 07:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums