How to calculate record of similar values in one column.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • irslan rafique
    New Member
    • Oct 2014
    • 40

    How to calculate record of similar values in one column.

    Hi,
    I am working in Query, Access 2010
    I have two Columns in query, Like:

    Column A
    Column B

    A
    1
    A
    2
    B
    3
    B
    4
    B
    1

    I want to show the total of A (3) and B(8) in column C

    Please advice.
    Thanks in advance
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    Use an aggregate query with the Sum Function.

    Code:
    SELECT Sum([Column A]) AS SumOfA, 
        Sum([Column B]) AS SumOfB 
    FROM [TableName] 
    GROUP BY [Column A];
    There is no need to have a separate column for the totals.

    Comment

    Working...