Results 1 to 2 of 2
  1. #1
    pcliaros is offline Novice
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    2

    Adding of Fields in Different records

    hi,

    i've been trying to work out how to add a certain field with every record to add onto each other in a query. so for example,

    ID-----Name-----Points


    1 Name 1 53.31
    1 Name 1 113.04
    2 Name 2 72.7
    3 Name 3 44
    3 Name 3 272

    into
    ID-----Name-----Points
    1 Name 1 166.35
    2 Name 2 72.7
    3 Name 3 316

    what sql statement would i have to use to merge (i'm guessing) the fields with the same id, but add the points field?

    much appreciated

  2. #2
    pcliaros is offline Novice
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    2
    did a bit of playing around and finally got it working:

    SELECT tbl.ID, First(tbl.Name) AS FirstOfName, Sum(tbl.Points) AS AllPoints
    FROM tbl
    GROUP BY tbl.ID
    ORDER BY Sum(tbl.Points) DESC;

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

Similar Threads

  1. Adding 2 fields together
    By Craig Spencer in forum Access
    Replies: 2
    Last Post: 04-08-2011, 02:10 PM
  2. adding records through form
    By Rayk in forum Forms
    Replies: 1
    Last Post: 01-09-2010, 07:55 AM
  3. Replies: 4
    Last Post: 09-21-2009, 01:51 PM
  4. datasheet view adding fields drop-down box
    By techexpressinc in forum Access
    Replies: 2
    Last Post: 09-09-2009, 05:35 AM
  5. Hiding fields that contains empty records
    By sakthivels in forum Reports
    Replies: 4
    Last Post: 05-27-2009, 07:06 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