Using In( ) operator in query criteria (1 Viewer)

Graham T

Registered User.
Local time
Today, 00:18
Joined
Mar 14, 2001
Messages
300
Just a quick question:

When using the In operator, can the list of values contain the wildcard (*).

A colleague is using an OR operator that is creating a very long criteria and I thought of using the In operator.

However the values she is entering contain * as she is searching on postcodes.

I have tried this using an example of:

In ("NG*", "DD*") and it is not returning any values.

TIA
 

ColinEssex

Old registered user
Local time
Today, 00:18
Joined
Feb 22, 2002
Messages
9,118
Try using the 'Like' operator in the query criteria

Col
 

Graham T

Registered User.
Local time
Today, 00:18
Joined
Mar 14, 2001
Messages
300
Colin

Thanks for the reply. I may not have explained properly:

The reason for using the IN operator was due to the fact that at present she is having to enter something along the line of the following:

Like "NG*" Or Like "MM*" Or Like "LL*" Or Like "JJ*" Or Like "DD*" etc. etc.

This creates a very long list.

Using the IN("NG*", "MM*" etc) makes this slightly shorter and easier, however this does not appear to work when entering wildcards.

So my original query should have read:

"Can I use wildcards when using an IN("List") operator?"

Graham
 

simongallop

Registered User.
Local time
Today, 00:18
Joined
Oct 17, 2000
Messages
611
Answer: NO!

Possible solution though is create a new field in your query DigTest:Left(FieldBeingTested,2) This will take the 2 left most characters from your list and then you can use your IN statement but without the need for wildcards. This is of course presuming that all the things that you are testing for are 2 characters followed by wildcard.

HTH
 

Graham T

Registered User.
Local time
Today, 00:18
Joined
Mar 14, 2001
Messages
300
Thanks for the reply Harry.

Something to consider....
 

Users who are viewing this thread

Top Bottom