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)
 
Back
Top