Computers & Electronics

MS Acccess - Join question

  • Last Updated:
  • Jan 17th, 2014 1:11 pm
Tags:
None
Deal Addict
Jun 13, 2009
1026 posts
277 upvotes

MS Acccess - Join question

tldr: Basically, need Table 1 in the example below to repeat SKU 123 to accomodate Table 2's two lines of data. So when the update query runs it picks up both shipped dates and not just one.

Hi, I am trying to update information in table1 with data from table2. In some cases, table2 could have multiple rows of data that relate to one row in table 1.

Based on the example below, I am trying to have Table 1 duplicate the row for SKU 123 twice to accomodate Table'2 two references for SKU 123. The same for SKU 789. The only one without an issue would be SKU 456. I assume this is how I am setting up the joins but man that stuff is confusing. I am no access expert (obviously), just self taught whatever I could from google but can't find anything about my specific issue.

This is a very basic example. There are 20 fields in each table, etc.


Ex.

Table 1
SKU Shipped on
123
456
789

Table 2
SKU Shipment# Shipped on
123 1 1/10/2014
123 2 1/15/2014
456 1 1/12/2014
789 1 1/14/2014
789 2 1/15/2014
789 3 1/16/2014
3 replies
Deal Fanatic
Aug 25, 2005
5485 posts
2762 upvotes
Not entirely sure what your desire result is... if its..

123
123
456
789
789
789

Then you could just update the table with "select table1.sku from table1 left join table2 where table1.sku = table2.sku"
Deal Addict
Jun 13, 2009
1026 posts
277 upvotes
Yeah, it would've helped if I wrote my expected results but that's pretty much what I want. I'll give it a try, thanks.
Member
User avatar
Nov 7, 2005
422 posts
41 upvotes
Edmonton
I'd recommend picking up a simple book on SQL. It would deal with tables, joins and how to do simple queries. It'd go a long way to helping you get a basic understanding.
_______________________________________________________
Can I has deal?

Top

Thread Information

There is currently 1 user viewing this thread. (0 members and 1 guest)