Share via

Multiple Criteria Access Query

Anonymous
2018-07-11T19:54:05+00:00

I would like my query results to not display BKCL in Texas. How should I construct my query?

Fund State Code Assets
0005 Texas BKCL 160.00
0007 Texas BKCL 188.00
0009 New York BKCL 155.00
0002 New York CORP 125.00
0003 Texas CORP 130.00
0010 Florida RETI 200.00
0004 Georgia TRST 150.00
0008 Maine TRST 177.00
Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2018-08-22T15:58:29+00:00

Is this what you want?

WHERE NOT(State = "Texas" AND [Retail Funds] IS NOT NULL)

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2018-07-12T16:16:06+00:00

Mea culpa!  It should have been:

SELECT *

FROM [YourTableNameGoesHere]

WHERE NOT(State = "Texas"

AND Code = "BKCL");

As I'd written it the Boolean AND operations required both columns to be NOT equal to the values, whereas what's needed is for both columns to be equal to the stated values, and then for the NOT operation to be applied to the result of the AND operation, which is what the above statement does.

It can also be expressed as a Boolean OR operation:

SELECT *

FROM [YourTableNameGoesHere]

WHERE State <> "Texas"

OR Code <> "BKCL");

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-07-12T14:39:39+00:00

    Thank you Ken for the reply.. however the results did not include "New York" and "BKCL". I have attached the query results based on your recommendation. I am not sure if this possible but the query needs to not bring in "Texas" when the code is "BKCL".

    0002 New York CORP 125.00
    0010 Florida RETI 200.00
    0004 Georgia TRST 150.00
    0008 Maine TRST 177.00

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-07-11T21:36:18+00:00

    I would like my query results to not display BKCL in Texas. How should I construct my query?

    Along these lines:

    SELECT *

    FROM [YourTableNameGoesHere]

    WHERE State <> "Texas"

    AND Code <> "BKCL";

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-07-11T20:11:35+00:00

    So the results should be;

    Fund State Code Assets
    0009 New York BKCL 155.00
    0002 New York CORP 125.00
    0003 Nebraska CORP 130.00
    0010 Florida RETI 200.00
    0004 Georgia TRST 150.00
    0008 Maine TRST 177.00

    Was this answer helpful?

    0 comments No comments