Use a function in update query

Posted on 2006-04-13
Last Modified: 2010-03-18
I have a table called isbnCodesTbl, in my Access 2003 database (see below).  Data is regularily imported into my webproducts table.  Webproducts has a field called isbn with a numberical value for each product. The isbn code corresponds to the isbn field in isbnCodesTbl.  I want a query to update a 2nd webproducts field called ExtText3 with the description that corresponds to the isbn code.

EG: update exttext3 with ConvertFunc([isbn])

isbn      desc
0      available, displayed
12      Duplicate SKU, not displayed
11      Has a New SKU#, not displayed
9      No longer in Inventory, not displayed
6      Out of Stock, can by reserved, display
8      Out of Stock, not displayed
7      Phone Order Only, displayed
10      Seasonal, not displayed
13      Sold by client's organization, displayed
1      Waiting for Instructions, not displayed
2      Waiting for Picture, not displayed
4      Waiting for Size, not displayed
5      Waiting for SKU, not displayed
3      Waiting for Text, not displayed
14      Waiting for Web Page, not displayed
15      Requested off website, not displayed

Thanks for any suggestions.

Question by:DavidDF1913
    LVL 15

    Accepted Solution

    I'm not a SQL guy and this is not the SQL area, but it would be something like this:

    UPDATE WebProducts INNER JOIN isbnCodesTbl ON WebProducts.isbn = isbnCodesTbl.isbn SET WebProducts.Description = [isbnCodesTbl].[Description];

    and you can also throw in:
    WHERE (WebProducts.isbn) = 10)) 'or whatever

    LVL 15

    Expert Comment

    only substitute the correct field names.  Like WebProducts.Description would become WebProducts.exttext3

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
    The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now