Results 1 to 9 of 9
  1. #1
    jcsports31 is offline Novice
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Posts
    3

    Find a SUM

    Does access allow you to find the sum of numerous rows of data, like excel does? I have 50k rows of data in excel, with multiple accounts that need to be added together. For insance:



    ACCT # Value
    1 2
    1 10
    1a 3
    1a 15

    Does access have a program or feature that would allow me to accumulate a SUM for the value of the accounts?

    Thanks,

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    SUM() and DSUM() both work.

    in a query, using SUM() requires using the GROUP BY clause on every field that the function is not being used on. the plus side to this is that your data will not be duplicated or redundant.

    DSUM() is good for one record only in a query (usually, unless you are combining with the DISTINCT keyword for unique records). the downsize to this is that if you have more than one record returned in the query, DSUM() will duplicate the range's (field's) sum in every record.

  3. #3
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    and while the AJETrumpet post is entirely correct - I'll also add for the novices out there to look at your textbook in queries section for the AggregateQuery. In the query design mode it is the epsilon E symbol in the tool bar. Access makes it very easy to do sums in queries this way.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by NTC View Post
    and while the AJETrumpet post is entirely correct - I'll also add for the novices out there to look at your textbook in queries section for the AggregateQuery. In the query design mode it is the epsilon E symbol in the tool bar. Access makes it very easy to do sums in queries this way.
    NTC,

    That is great. Thanks for adding it. I don't think domain aggregates are options though with the summation line, are they? DSUM might have to be written out, which is what I think he needs here rather than grouping.

  5. #5
    centaurr is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    4
    I have a question very similar to the OP. I have two columns of information just like OP's and need to output sums of the value column per ACCT#.

    ex of table:
    acct / value
    A / 1
    A / 2
    B / 2
    B / 3

    end result:
    A = 3
    B = 5

    Any thoughts?

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    not a thought, but here's the correct answer:
    Code:
    SELECT col1, sum(col2)
    
    FROM ...
    
    GROUP BY col1

  7. #7
    centaurr is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    4
    how can I apply what you've given me to output the sums and ACCTs in a textbox on a form?

    the columns are being displayed in a subform.

    TIA

  8. #8
    centaurr is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    4
    nevermind.

  9. #9
    centaurr is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    4
    thanks for your help ajetrumpet

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

Similar Threads

  1. Filter vs Find ?
    By Huddle in forum Access
    Replies: 4
    Last Post: 07-16-2010, 08:59 AM
  2. Looping through a tbl to find a certain value
    By cwf in forum Programming
    Replies: 1
    Last Post: 05-17-2010, 04:02 PM
  3. Need help to find a function
    By lil in forum Access
    Replies: 7
    Last Post: 03-24-2010, 12:14 PM
  4. Find tables
    By Jaime in forum Access
    Replies: 2
    Last Post: 11-04-2009, 01:52 PM
  5. How to Find a Record
    By lschlitt in forum Programming
    Replies: 2
    Last Post: 09-09-2006, 06:24 PM

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