+ Reply to Thread
Results 1 to 5 of 5

Query Criteria - how to look for records that contain some things, but not another.

  1. #1
    Registered User
    Join Date
    07-01-2012
    Location
    Hickory, PA
    MS-Off Ver
    Excel 2002
    Posts
    2

    Question Query Criteria - how to look for records that contain some things, but not another.

    I have to do a query but don't know how to put in the criteria for one of the fields indicating a type of order. The values in this field are either 1, 2 or 3. I want to find all the orders for customers who have a 2 or a 3, but do not have a 1. I don't do a lot of queries, and I usually don't have to do this type. Any help would be greatly appreciated. Thank you in advance for your help.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Query Criteria - how to look for records that contain some things, but not another.

    Can you upload example workbook?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Query Criteria - how to look for records that contain some things, but not another.

    have you tried to apply filters?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    07-01-2012
    Location
    Hickory, PA
    MS-Off Ver
    Excel 2002
    Posts
    2

    Re: Query Criteria - how to look for records that contain some things, but not another.

    Quote Originally Posted by FDibbins View Post
    have you tried to apply filters?
    This is what happens from trying to work on things at 4:30 am in the morning. My brain was fried!! The query was for Access, not Excel, though I did export it as an Excel worksheet and tried to see if I could get the same information from the spreadsheet.

    In the spreadsheet there is a particular field (BusCtr) where there is only a 1, 2 or 3 for each order, and each order has a distributor ID# associated with it. I want to find out the distributors who have either a 2 or 3 but have neverhad a 1 associated with their orders. Am I correct in thinking this would have to be done in Access with a query?

    I'm OK with simple queries in Access and sorts in Excel, but when I have to find records that don't have a particular value I'M LOST!!! If this is something that can't be done through Excel, I'll just mark this thread "solved" Have a wonderful evening and thank you for your response.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Query Criteria - how to look for records that contain some things, but not another.

    sorry for the late reply, i was unavailable. under filters, you can use "nummber filters" and use "not equal to"

    i think that give you what you need

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1