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. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 18 Times in 18 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.

  3. #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
  •