Results 1 to 7 of 7
  1. #1
    eeps24 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    39

    design view - how to add two vaules in a critera

    In design view for the criteria field I need to look for (for example) apples and oranges. How do I add both to my criteria?

    "apples" and "oranges"



    I tried that above but its not working.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Try

    "apples" or "oranges"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    eeps24 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    39
    but i want both apples and oranges, not OR. I need both.

    is my AND statement correct though?

  4. #4
    eeps24 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    39
    is my AND statement correct though?

    or should I use the IN statement to search for two or more values?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What does the data look like? And would normally apply to 2 different fields. One field typically can't be both apples and oranges at the same time.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    No record can meet the criteria of "apples and oranges" if the data is in one field - use OR operator, like:

    SELECT * FROM Table WHERE field = "apples" OR field = "oranges";

    or use IN operator, like:

    SELECT * FROM table WHERE field IN ("apples", "oranges");

    Review http://www.allenbrowne.com/ser-62.html

    Provide sample dataset and desired output.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Looks like June7's going to take over.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 05-27-2015, 02:23 PM
  2. Replies: 6
    Last Post: 05-09-2014, 09:03 AM
  3. Replies: 6
    Last Post: 03-08-2014, 12:47 PM
  4. Replies: 2
    Last Post: 01-28-2014, 10:13 PM
  5. Replies: 5
    Last Post: 12-03-2013, 01:25 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