Results 1 to 4 of 4
  1. #1
    maindaco is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Jul 2013
    Posts
    2

    Problem with "Not" criteria used in Select Query


    I have a set of records in a Table and I'm using a Select Query to obtain only the records not equal to "Blue 123", this is a Text field and chances are that other values exist like "Yellow 456", "Red 789" and even can exist Null data. However, when I run the query, it doesn't work perfectly. It seems that it excludes "Blue 123" and Blank fields and shows anything else. I also tried using "Not Like" in criteria without any luck. Any idea and explanation of why this happens and how to correct it? Thanks.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Can you show us the SQL of your query.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    maindaco is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Jul 2013
    Posts
    2
    SELECT [tbl000-TMC Details].Period, [tbl000-TMC Details].Year, [tbl000-TMC Details].Country, [tbl000-TMC Details].DocumentNo, [tbl000-TMC Details].[Amount LC], [tbl000-TMC Details].Currency, [tbl000-TMC Details].Comments, [tbl000-TMC Details].Text
    FROM [tbl000-TMC Details]
    WHERE ((Not ([tbl000-TMC Details].Comments)="Blue 123"));

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I think the following WHERE clause should give the desired result. If not, can you post a copy of your db.
    WHERE ((([tbl000-TMC Details].Comments)<>"Blue 123"));
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 3
    Last Post: 04-10-2013, 01:20 PM
  2. Replies: 3
    Last Post: 04-03-2013, 10:39 PM
  3. Replies: 1
    Last Post: 10-08-2012, 09:01 AM
  4. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 AM
  5. ComboBox "Select" and "DLookUp"
    By witooldas in forum Forms
    Replies: 0
    Last Post: 03-23-2011, 03:31 AM

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