Results 1 to 10 of 10
  1. #1
    hawg1 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    9

    sum matching records with one different field

    I created a query that finds duplicate records based on the NIIN field from excel data tthat is imported into access. The result looks like this.

    FSC --- NIIN ------- SD --- Net QTY -- NRTS QTY -- Credits -- Net ------ Noun
    1650 -- 10281115 -- MSD -- 6 --------- 6 ---------- $0 ------- $90,247 -- MANIFOLD ASSEMBLY,H
    1650 -- 10281115 -- MSD -- 3 --------- 3 ---------- $15,041 -- $45,123 -- MANIFOLD ASSEMBLY,HYDRAULIC



    I don't control how the data is entered into the excel worksheets. They come from a myriad of external sources. Here is what I am alluding to; both of these entries, based on the NIIN field, are identical items (the dashes represent column breaks); the Noun field in one record is truncated in the excel sheet for some reason I can't explain:

    What I wish to do is combine these two records into one, with the Net QTY, NRTS QTY, Credits and Net columns summed up but also insert one of the two Noun fields (the longer string) so that it would look like this:

    FSC --- NIIN ------- SD --- Net QTY -- NRTS QTY -- Credits --- Net ------- Noun
    1650 -- 10281115 -- MSD -- 9 --------- 9 ---------- $15,041 -- $135,370 -- MANIFOLD ASSEMBLY,HYDRAULIC

    Any Ideas?

  2. #2
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    Use Microsoft Excel PivotTable. I'm absolutely sure this will work for you. But I think you should be looking for Excel forums instead.

  3. #3
    hawg1 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    9
    Quote Originally Posted by evander View Post
    Use Microsoft Excel PivotTable. I'm absolutely sure this will work for you. But I think you should be looking for Excel forums instead.
    evander,

    this is not an excel table but an access table. The data originated excel but is then imported into access.

  4. #4
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    Then create a Group By query. It basically achieves the same purpose as a PivotTable.

  5. #5
    hawg1 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    9
    Quote Originally Posted by evander View Post
    Then create a Group By query. It basically achieves the same purpose as a PivotTable.
    I have already done that. But due tothe differences in teh NOUN field of the two records, access doesn't not think they are teh same record when in reality they are.

  6. #6
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    So basically, if the two records have the same FSC, NIIN, and SD values, such records will be "grouped" as one, regardless if they have different Noun's?

    Is this a one-time operation, or do you need to automate this task every time you import data from Excel?

  7. #7
    hawg1 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    9
    Quote Originally Posted by evander View Post
    So basically, if the two records have the same FSC, NIIN, and SD values, such records will be "grouped" as one, regardless if they have different Noun's?
    That is correct!

    Quote Originally Posted by evander View Post
    Is this a one-time operation, or do you need to automate this task every time you import data from Excel?
    This would need to be an automated function as the excel data would be imported each month.

  8. #8
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    How will the automated procedure know which "Noun" should a particular row take up, given a list of similar "Noun"s. Is it always the longest?

    I'm on my way to solving your problem.

  9. #9
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    This solution may not be the most elegant, but at least it works for me.

  10. #10
    hawg1 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    9
    Quote Originally Posted by evander View Post
    This solution may not be the most elegant, but at least it works for me.
    Thanks for the code, I'll look it over and see if that will resolve my situation.

    Thanks for the help

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

Similar Threads

  1. String Matching
    By tuna in forum Programming
    Replies: 1
    Last Post: 05-16-2010, 12:22 PM
  2. Join queries that do not have matching field
    By Petefured in forum Queries
    Replies: 2
    Last Post: 05-04-2010, 11:19 AM
  3. Delete all records in a field
    By cotri in forum Forms
    Replies: 6
    Last Post: 01-29-2010, 02:44 PM
  4. Replies: 2
    Last Post: 01-22-2010, 03:53 PM
  5. changing a records field value
    By tubar in forum Queries
    Replies: 3
    Last Post: 07-06-2009, 07:36 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