Results 1 to 2 of 2
  1. #1
    dclark28 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    1

    Post Compare sum of values in rows with same ID to another value


    Hi All,

    I am not sure if this would be a better project for Excel or Access but here is what I am trying to do and I apologize if I am not explaining this well as it is a bit hard to explain.

    I need to compare the sum of a values in a column of rows with the same id. For example:
    Code:
    ID          Value1   Value2
    
    122222   20        40      (these are okay, the sum of Value1 in rows with same ID equal value 2)
    122222   20        40
    333333   100        100      (ok)
    111111   50          100      
    111111   50          100      (not ok, the values with same id add to 150, so the first row containing this id should be deleted so the the total of Value1 equals Value2)
    111111   50          100
    Thanks for any help!

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You might consider creating a Query - and then doing a Group By on ID, Sum on Value1 and Average of Value2?
    This would work with the data you're showing [where all values under Value1 for the same ID are identical - AND all values under Value2 for the same ID are identical].

    This would give you the two values you want to compare.

    BUT . . . if you want to delete rows [you said "so the first row containing this id should be deleted . . ."] - then that's a different ball game.

    It's not totally clear what you need your end result to be. Could you perhaps explain a little more?

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

Similar Threads

  1. Replies: 2
    Last Post: 12-19-2011, 10:51 AM
  2. Replies: 3
    Last Post: 12-06-2011, 07:37 AM
  3. Replies: 2
    Last Post: 08-28-2011, 06:06 AM
  4. Replies: 6
    Last Post: 07-21-2011, 04:51 AM
  5. Create Query to Compare Values
    By shannon9585 in forum Queries
    Replies: 4
    Last Post: 12-29-2010, 05:55 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