Results 1 to 4 of 4
  1. #1
    austin is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    2

    How to build a query that if two columns in one table matches....

    .... then it creates a field that combines one of them with a coded value for the other?

    In other words, I have two tables, one has two columns: the beginning of a sku number (call it "SkuBase"), and a number 1 through 4 for each specific SkuBase. Example:
    (table has been censored to protect sensitive information)

    Click image for larger version. 

Name:	Product Option Matching.PNG 
Views:	8 
Size:	3.3 KB 
ID:	32842

    The other table has a list that defines what number is associated to an additional sku part.
    Example (in this table, the middle column doesn't matter, but the first column is named the same as the second column in the first table):

    Click image for larger version. 

Name:	finish.PNG 
Views:	8 
Size:	2.8 KB 
ID:	32841

    I need to take each value in the first table first column, and add to it the two letter code that's associated to each number. For example, in the first table, I need the first values in the new field to look like:
    (* represents values hidden)
    CH*****-30-MB
    CH*****-30-GB
    CH*****-30-BS
    CH*****-30-FB

    I understand what needs to happen, and I keep getting close. But as I have a bit of experience with Excel but none with Access, I would love to learn how to use access, especially to do this. Any help would be great, thank you!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in a query:
    join tSkuBase table to tSkuPart table on [single#] field
    then in the query make a new field via:

    NewPart:
    tSkuBase.[sku#] & "-" & tSkuPart.[2Ltr]


  3. #3
    austin is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    2
    Thank you!....but, how do you join?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

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

Similar Threads

  1. Replies: 3
    Last Post: 10-24-2017, 05:16 PM
  2. Replies: 7
    Last Post: 02-29-2016, 06:13 PM
  3. Replies: 2
    Last Post: 02-10-2016, 07:48 AM
  4. Replies: 2
    Last Post: 10-26-2015, 06:14 AM
  5. Replies: 1
    Last Post: 06-12-2015, 02:02 PM

Tags for this Thread

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