Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reporting (Match [WAD] (*a* or *b*) or [WAD] = c AND Match [WAD] (*d* or *e*) or [WAD = f) Then &quo 1

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
Good morning I'm trying to replicate some SQL to filter a report where there are 3 alternative criteria AND another 3 different criteria.

So I'd like to create one variable that will return "1" if it is true.

So far I know how to:

=If Match( [WAD]; "*EAU*") Then 1

but I'd like advice on the best way to put this together please.

Many thanks,
D€$
 
I think I'm getting there:

=If Match( [WAD]; "*a*") Or Match( [WAD]; "*b*") Or [WAD] = c) Then 1

Many thanks,
D€$
 
Hmm, OK:

=If (Match( [WAD]; "*a*") Or Match( [WAD]; "*b*") Or [WAD] = "c") And (Match( [WAD1]; "*a*") Or Match( [WAD1]; "*b*") Or [WAD1] = "c") Then 1

Now this appears to do what I want as I don't have any matches when I just put this variable in the report. However, when I add this variable to the Report Filters 'Equal to 1' it does nothing and still displays all the rows - which I don't understand.

Many thanks,
D€$
 
When you have ANDs & ORs the placement of the parentheses is super critical.
 
Is this what you intended?

Code:
If (
       Match( [WAD]; "*a*") Or 
       Match( [WAD]; "*b*") Or 
       [WAD] = "c"
   )
    And 
   (
       Match( [WAD1]; "*a*") Or
       Match( [WAD1]; "*b*") Or
      [WAD1] = "c"
   ) 
   Then 1
 
Yes Skip, that looks about right. Thanks. I probably had either filtered on the incorrect field or thought I was using one variable instead of another.

Many thanks,
D€$
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top