Results 1 to 6 of 6
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    Filter for equation result


    I have two numerical table sources that I identify as A and B (actual names are identical from the two sources). I would like to apply a query filter to not display records where A=B. I added an entry A-B and tried to filter it for <>0. Also tried IIF(A=b etc. The query happily displays 0 when not filtering, but when I try to filter for <>0 or 0, I get error message "Enter Parameter Value". Appreciate any help. Using Access 2007

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    This can happen when you filter on a calculated field, because of the order in which clauses are evaluated. Why not just put <>B in the criteria for A?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Quote Originally Posted by pbaldy View Post
    This can happen when you filter on a calculated field, because of the order in which clauses are evaluated. Why not just put <>B in the criteria for A?
    Doesn't work. Access puts quotes around B (<> "B"), whether I want it or not. If change to [B] doesn't work either. I did find that if, in the calculated field, I changed A and B to NameOfTable.NameOfField-NameOfOtherTable.NameOfField and filtered for <>0, works. so can do it, but seems a little clumsy.

    Thanks for quick reply.

  5. #5
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Thanks for reply. Look at other input from pbaldy.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I suspect if you'd used the same syntax in the criteria, it would have worked. In SQL view:

    WHERE NameOfTable.NameOfField <> NameOfOtherTable.NameOfField
    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: 0
    Last Post: 08-23-2017, 09:32 AM
  2. Filter a filter result
    By Viking02 in forum Macros
    Replies: 2
    Last Post: 04-19-2017, 04:12 PM
  3. Replies: 7
    Last Post: 08-28-2014, 01:33 PM
  4. Replies: 1
    Last Post: 12-20-2011, 03:32 PM
  5. Another equation almost done now
    By stryder09 in forum Access
    Replies: 4
    Last Post: 02-18-2011, 12:18 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