• Manipulating Duplicate Values (2000)

    Author
    Topic
    #363785

    I have a table with an Area field, ID number field and other fields. Some of the records have matching ID numbers, though the Area data is unique for each record. For such records, the other fields contain duplicate data. What I want to do is generate a new record consisting of the Sum of the Area for the two records that have matching ID numbers, as well as a copy of the other duplicate fields. Then I want to delete the matching records. It would also be fine to end up with one table containing the original records plus a new table containing only unique values plus the new records generated by the Sum operation. I could then just delete the entire old table in favor of the new table.

    Original data:
    ID Area Units New_Units
    1 305 1 2
    2 4000 2 4
    2 250 2 4
    3 1200 1 4

    Desired result:
    ID Area Units New_Units
    1 305 1 2
    2 4250 2 4
    3 1200 1 4

    Is it possible to easily accomplish this or is this complicated?

    I don’t know how to program. I know a bit about setting up Expressions in the Query Design window and creating Macros.

    Any help would be appreciated.

    Jeff

    Viewing 0 reply threads
    Author
    Replies
    • #556219

      Hi Jeff,
      From what you’ve described, this sounds relatively straightforward. You need a make-table query which groups on ID, uses Last functions on all the duplicate fields, and Sum on the Area fields.
      Hope that helps.

      • #556227

        Perfect! Thanks for the quick response, I really appreciate it.

    Viewing 0 reply threads
    Reply To: Manipulating Duplicate Values (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: