Results 1 to 4 of 4
  1. #1
    zdjbel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    25

    Find the matching dates in tables A & B, then populate blank fields in A from B


    Hello,

    I have a table tROE with a field listing all dates starting 1/1/10 to date (populated), and three fields for currency exchange rates [USD], [RSD] & [EUR] which are empty and need to be populated. I have another table tROEPartial that has the exchange rates for some of the dates starting 1/1/10 but not all. Their structures are identical. I want to add the exchange rates from tROEPartial to tROE where the dates match, leaving the unmatched fields in tROE blank. How do I do this?

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    First, make a backup copy of the database in case things do not go as planned.

    The easiest way is to start with a SELECT query. Create a new query, add both tables. Join the two tables via the date fields in each. Select the 3 exchange rate fields from tROE. Change the query type to UPDATE and in the Update to: row, type in the names of the corresponding fields from tROEPartial

  3. #3
    zdjbel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    25
    Thanks very much for responding. I tried this before and it didn't work for reasons I can't figure out. After posting this thread I did some more research and found that a union query was just the thing I needed. I got the results I wanted with the following SQL query:

    SELECT tROE.RoeDate, tROE.USD, tROE.RSD, tROE.EUR
    FROM tROE
    UNION SELECT tROEPartial.RoeDate, tROEPartial.USD, tROEPartial.RSD, tROEPartial.EUR
    FROM tROEPartial;

    From what I can tell, its the same thing that you suggested except for the Union statement, but then again, looks can be deceiving and I'm hardly an expert on SQL or Access for that matter. Thanks very much again, I appreciate your time and suggestion, and I will play around with it until I get it to work - I just have to figure out what I didn't do right, but for the record, I consider this resolved.

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Would it be possible for you to zip & post a copy of the database? Then I can try to see what is going on with the UPDATE query. Please make sure to remove/alter any sensitive info.

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

Similar Threads

  1. Replies: 3
    Last Post: 02-06-2012, 10:34 AM
  2. Replies: 1
    Last Post: 10-24-2011, 08:01 AM
  3. Replies: 1
    Last Post: 08-11-2011, 11:33 AM
  4. Using if to find blank fields?
    By newtoAccess in forum Queries
    Replies: 4
    Last Post: 03-20-2011, 10:48 AM
  5. Replies: 6
    Last Post: 02-10-2011, 07:09 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