Results 1 to 4 of 4
  1. #1
    twckfa16 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    5

    Macro to parse data and compare tables

    Hello - not sure if this is in the right spot or not.



    I have three files in a zip attached below - central_data, nov142014-test, and result-central_data -
    all files from excel.

    I need to import the central_data, and the nov14 file into access and do a comparison between the two.
    The "result" file is just for illustration purposes - the central_data file will be updated in reality.

    Let's just take the first record. They are identical except the Data2 column starts with 1000 in one
    and 1500 in the other. For my purposes, if we ignore the numbers in front they are identical.
    So the central_data file would not change.

    The second record is completely identical, so the central_file would not change either.

    The third record does not exist in the central_data file so it would be inserted as a new record,
    dropping what was originally there to the fourth spot.

    Like I said, the "result" is what the new central_data file should look like.

    So....can Access loop, parse data etc...and then loop through another table and perform updates?

    Sorry for being so lengthy but would help if someone could point me in the right direction.

    Thank you
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    OMG, that is a horrible way to store data.

    But you dont have to import the data, you can LINK the xl tables in, then run a query.

    I got DATA & NOV to match DATA.data1 to NOV.data1 join.
    then
    DATA.data2 to NOV.data2 join.

    So you should be able to do the same.

  3. #3
    twckfa16 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    5
    Hi ranman -

    Thank you for responding and I know its been a couple months....I understand, unfortunately that's how the data is stored.

    How did you construct the joins - if you remember?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is the Data1 value unique in both tables? If this value is found in both tables then the Nov Data2 value should be used to replace the value in Central table?

    A Find Unmatched query could identify new records.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Parse Data by Month
    By dccjr in forum Queries
    Replies: 6
    Last Post: 04-01-2013, 09:15 AM
  2. Replies: 4
    Last Post: 11-21-2012, 03:17 PM
  3. Replies: 4
    Last Post: 07-09-2012, 01:49 PM
  4. Compare Data in Multiple Tables
    By Access_newbie in forum Queries
    Replies: 7
    Last Post: 07-26-2011, 11:35 AM
  5. Parse a File from a Directory and write data to table
    By galahad in forum Database Design
    Replies: 0
    Last Post: 04-23-2009, 08:38 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