Results 1 to 3 of 3
  1. #1
    wconan is offline Novice
    Windows 7 Access 2003
    Join Date
    Mar 2010
    Posts
    3

    how to group?

    Hello I like to know how to group in access?



    I got

    1A 4
    1B 5
    1C 6
    2A 7
    2B 8
    2C 9

    I want
    N 15
    S 24

  2. #2
    NassauBob's Avatar
    NassauBob is offline Not THAT Green
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Location
    Augusta, GA
    Posts
    61
    Looks like you want to add the number of ___s by the first number in the first column.

    Try this in your query:

    select iif(left([col1],1)="1","N","S"), sum([col2])
    from [tablename]
    group by left([col1],1)

    substituting my blue variables with your actual table and column names.

    Hope this helps! If you need an explanation of the iif() function, and cannot find one online or in the help, PM me.

  3. #3
    wconan is offline Novice
    Windows 7 Access 2003
    Join Date
    Mar 2010
    Posts
    3
    thanks

    Yes I want to add 1A,1B,1C, into one group and 2A, 2B,2C INTO Another group. I'm going to try your method to see if it works.

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

Similar Threads

  1. Group by
    By EstesExpress in forum Queries
    Replies: 0
    Last Post: 02-26-2010, 07:52 AM
  2. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 AM
  3. Smallest in group
    By pvanryzin in forum Queries
    Replies: 3
    Last Post: 08-17-2009, 09:42 AM
  4. Group By
    By SMAlvarez in forum Access
    Replies: 0
    Last Post: 10-28-2008, 04:40 PM
  5. Top 2 by group
    By griz in forum Access
    Replies: 0
    Last Post: 05-25-2008, 07:10 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