Results 1 to 4 of 4
  1. #1
    Jerry Call is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    May 2020
    Location
    Champaign, Illinois
    Posts
    85

    Syntax problem in query involving NOT in WHERE clause

    I'm trying to write a WHERE clause that includes only records where UnitType is NOT equal to "Supplies".

    I've tried various permutations for "NOT equal", but none of them work.



    I've tried playing with Like as well, but everything I try returns an error.

    Can you give me the SQL that does the job?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    First thought

    ...Where UnitType <> "Supplies";

    But there may be other things you haven't mentioned that are important to your query.

  3. #3
    Jerry Call is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    May 2020
    Location
    Champaign, Illinois
    Posts
    85
    Aha! You're right! I discovered a different problem in the syntax. It wasn't the <> vs = operator.
    Anyway, I've now solved the problem. Many thanks!

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

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

Similar Threads

  1. Replies: 7
    Last Post: 01-05-2019, 11:17 AM
  2. Problem With Group by clause in a Query
    By deepakg27 in forum Queries
    Replies: 1
    Last Post: 01-15-2018, 11:35 PM
  3. Replies: 4
    Last Post: 01-09-2018, 03:28 PM
  4. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  5. Where clause syntax
    By stupesek in forum Reports
    Replies: 7
    Last Post: 09-03-2010, 02: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