Results 1 to 4 of 4
  1. #1
    craigcam is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Nov 2019
    Posts
    1

    Multiple rows to single row separate fields

    I have multiple rows of data for a specific number and I want to show it all on one line as a result.

    table as follows


    Article Case weight Inner weight
    123 4
    123 6

    Result should be
    Article Case weight Inner weight
    123 4 6

    I have access 2003.


    Thanks,

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    This can be done easily with an Aggregate (Totals) Query.
    Simply do the following:

    1. Create a new query based on this table
    2. Add the three fields above to the query
    3. Click on the Totals icon (looks like a Sigma)
    4. Under the two weight fields, change the phrase "Group By" to "Sum".

    View your results

    It "groups" the records by the Article number, and sums the other two fields.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This would work on your example:

    SELECT Article, Max([Case Weight]) As CaseWeight), Max([Inner weight]) As InnerWeight
    FROM TableName
    GROUP BY Article
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    You can also load your table to Power Query/Get and Transform and reorganize your data there.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-01-2019, 06:01 AM
  2. Replies: 3
    Last Post: 08-22-2018, 11:05 AM
  3. Merge Multiple Rows To Single Row
    By Juan4412 in forum Programming
    Replies: 12
    Last Post: 05-23-2017, 09:43 AM
  4. Replies: 5
    Last Post: 10-22-2016, 12:30 PM
  5. Replies: 5
    Last Post: 04-10-2012, 08:53 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