CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2012
    Posts
    7

    Updating table data from another table

    Hello. I'm creating a database for a reporting system for my work and have a question I'm hoping someone can answer.

    First of all, some details.

    I'm using Access 2010 for the database, VBA for the coding and server 2k8 as the O/S.

    Ok then, onto the problem. I have a collection of .csv files which contain the data I require. These .csv's are produced every day. What I'd like to do is to merge the contents of the latest csv, into a table which contains all previous csv's.
    These csv's could contain the same data as the last csv as well as new data.

    I've created an import routine which will import the latest file into a new table ready for merging, I just need some help with the actual merge.

    As an example, I'll detail a sample of what each table contains.

    (Previously imported table)
    Key: IDNumber = 100
    Open Date = 01/02/2003
    Resolve Date
    Close Date

    (New table to import)
    Key: IDNumber = 100
    Open Date = 01/02/2003
    Resolve Date = 02/03/2003
    Close Date

    As you can see, they both have the same unique ID, but the new table has some additional data I'd like to update the existing record with, as well as appending wholly new records. I don't want to iterate through both tables as the new data contains ~15000 rows, and the existing table has the same number of rows multiplied by the number of days data which has previously been imported! :s


    I hope this makes sense and someone can assist!

    Thanks in advance.

  2. #2
    Join Date
    Jun 2012
    Posts
    7

    Re: Updating table data from another table

    If anyone wants to know, I solved this by brute forcing it.

    I used an update query, then an append query. Not elegant but effective.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured