And Statements

  • Thread starter Thread starter antmorano
  • Start date Start date
A

antmorano

Hi I am trying to create and And statement and this is what I
currently have:

[Status of Coverage- Retiree]<>"CANCELLED" And [Status of Coverage-
Spouse]<>"CANCELLED" Or Is Null

What I am trying to do is if Status of Coverage- Retiree equals
"CANCELLED" and Status of Coverage- Spouse equals "CANCELLED" or is
null then skip the record.

If there is a cancel in both fields then I need the record to be
skipped.
 
Hi I am trying to create and And statement and this is what I
currently have:

[Status of Coverage- Retiree]<>"CANCELLED" And [Status of Coverage-
Spouse]<>"CANCELLED" Or Is Null

What I am trying to do is if Status of Coverage- Retiree equals
"CANCELLED" and Status of Coverage- Spouse equals "CANCELLED" or is
null then skip the record.

If there is a cancel in both fields then I need the record to be
skipped.

You need to repeat the field name for each criteria condition.
Try it this way:

[Status of Coverage- Retiree]<>"CANCELLED" And [Status of Coverage-
Spouse]<>"CANCELLED" Or [Status of Coverage- Spouse] Is Null

Also, there are times when it is necessary to wrap individual parts of
the where clause within parenthesis to determine how the criteria is
processed.

Compare the above (without any parenthesis) to the 2 additional
variations below. I've used A and B just to shorten my typing.

([A] <> "Cancelled" And <> "Cancelled") Or Is Null
may give a different grouping of records than
[A] <>"Cancelled" And ( <> "Cancelled" Or Is Null)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top