Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update query (Access 2000)

    I would like to change the categories of the products whereas the categories 8,9,10,11 and 14 to be changed to category 12.How can i do that ?

    SELECT products.grade, products.code, categories.categoryid, categories.CategoryName
    FROM products INNER JOIN categories ON products.categoryid = categories.categoryid
    WHERE (((categories.categoryid)=8 Or (categories.categoryid)=9 Or (categories.categoryid)=10 Or (categories.categoryid)=11 Or (categories.categoryid)=12 Or (categories.categoryid)=14));

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Update query (Access 2000)

    Create a query in design view based on the products table (you don't need the categories table here).
    Add the categoryid field to the query grid.
    Select Query | Update Query.
    Enter the following expression in the Criteria line:
    <code>
    In (8,9,10,11,14)
    </code>
    Note: if your system uses a comma as decimal separator and a semi-colon as list separator, use
    <code>
    In (8;9;10;11;14)
    </code>
    Enter 12 in the Update to line.
    Select Query | Run to execute the update query.
    If you're interested in the SQL statement for this query, select View | SQL.

  4. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update query (Access 2000)

    Excellent ! Thank you so much !

Posting Permissions

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