Results 1 to 5 of 5
  1. #1
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283

    Append Query Help

    Hello,



    For example I have this field name which is FruitName, and I have 500 rows in this field with multiple different fruit names. For example apple CPN, orange SSD, pear ATS. And I created a new field called Category, the field is blank because I just made it. I want to write a query so whatever row has the text CPN, SSD, or ATS, it will display an "S" for SSD, "D" for CPN, and "D" for ATS in the Category field. I'm guessing an append query needs to be created to make this work. If someone can help me out and which is the best way to do it let me know. Thank you.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This would be an Update query to update the new Category field for each row.

    If this is a one-off deal, easiest would be to keep using the same query and do them one by one (create the query, run it, change the values, run it, etc), otherwise it would take a complicated "IIf" statement. Bring in the FruitName field and in the criteria line put - Like "*CNP*", then update the Category field to "S". Etc.

  3. #3
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    There's about a hundred different Fruit Names. I can't go one by one changing each fruitname to "S" or "D".

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Are you saying there are only three types? If so, the fruit field can be displayed as Right(FruitName,3) and then in the criteria row when it is CPN or ATS update the category to "D" (run query), second time change it to "SSD" and "S" (run query). Your category should really belong in a different table, your fruitnames should also belong in their own table, so there are always one of each. I don't understand why you have 500 rows.

  5. #5
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    theres a hundred different types of fruit..but hey all end with SSD, CPN, ATS.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  2. append query
    By gimmy in forum Queries
    Replies: 1
    Last Post: 09-09-2011, 10:41 AM
  3. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  4. Append query won't append
    By yelkenli in forum Queries
    Replies: 5
    Last Post: 02-12-2010, 11:19 AM
  5. Append Query
    By aabh in forum Queries
    Replies: 6
    Last Post: 02-02-2010, 04:26 PM

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