Results 1 to 6 of 6
  1. #1
    geocan2006 is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    May 2016
    Posts
    34

    Unique sort and sum

    I need a query expression to result below sorting,



    Thanks

    Table1
    Model Qtty
    Red 1
    Red 2
    Red 3
    Yellow 8
    Yellow 4
    Black 5
    Orange 2

    Query1

    Red 6
    Yellow 12
    Black 5
    Orange 2

  2. #2
    geocan2006 is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    May 2016
    Posts
    34

    Unique sort and sum

    I need a query expression to result below sorting,

    Thanks

    Table1
    Model Qtty
    Red 1
    Red 2
    Red 3
    Yellow 8
    Yellow 4
    Black 5
    Orange 2

    Query1

    Model Qtty
    Red 6
    Yellow 12
    Black 5
    Orange 2

  3. #3
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You can use a Totals Query to get your sums.
    Simply group by Model and Sum the Qtty field.
    See here for details: http://www.fontstuff.com/access/acctut04.htm

    However, what determines what order they should be sorted in?
    Remember that the current "Order" the records are listed in in a Table really has no meaning.
    Is there another field it can sort by?
    Or do you have some sort of table that lists the different colors and how they should be sorted?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    To sum the quantities create a Totals query (the E icon on the top). What is the sort order you need?

  5. #5
    geocan2006 is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    May 2016
    Posts
    34

    Unique sort Location ID

    Thanks,
    Sorry that was very elementary,
    I am posting new thread

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Duplicate threads merged since both had replies. In the future, please don't post the same question twice.
    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. Replies: 1
    Last Post: 04-07-2014, 02:59 AM
  2. Replies: 22
    Last Post: 03-03-2013, 02:00 PM
  3. sort filter, doesn't sort everything
    By deso in forum Queries
    Replies: 4
    Last Post: 01-25-2013, 05:27 AM
  4. Unique queries - Unique Count
    By bigfish in forum Queries
    Replies: 7
    Last Post: 03-14-2012, 01:28 PM
  5. How to sort by three sort orders
    By captgnvr in forum Access
    Replies: 4
    Last Post: 11-09-2009, 07:30 AM

Tags for this Thread

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