Having problem with like string

  • Thread starter Thread starter SirPoonga
  • Start date Start date
S

SirPoonga

I have a query with the criteria
Like "##?#*"

It is matching fields that contain values like "1526343"
Why is the question mark not matching an alphabetical character
character?
 
SirPoonga said:
I have a query with the criteria
Like "##?#*"

It is matching fields that contain values like "1526343"
Why is the question mark not matching an alphabetical character
character?

Are you saying that it isn't? I'd be surprised if it didn't. But it
should also match any numeric digit. The question mark wildcard
character should match *any* single character, numeric or alphabetic or
punctuation or "special".

Maybe you want to use this pattern:

Like "##[a-z]#*"
 
Hmmm, so it comes down to what MS Access Help defines as alphabetical
character.

"? Matches any single alphabetic character. B?ll finds ball, bell, and
bill "

So it would also find b4ll, b^ll, etc...
 
SirPoonga said:
Hmmm, so it comes down to what MS Access Help defines as alphabetical
character.

"? Matches any single alphabetic character. B?ll finds ball, bell, and
bill "

So it would also find b4ll, b^ll, etc...

Where in the help file (and what Access version's help) are you quoting
from? I haven't been able to find that quote anywhere, but it should be
corrected wherever it is. All the help entries I see say "? Matches
any single character." -- no mention of alphabetic that I can find.
 
Access 2000 9.0.6926 SP-3

In Access Help (not VBA help) I did a search for "wildcard" The page
that decribes that is first.

If I search in VBA it says "? Matches any single character."
 
SirPoonga said:
Access 2000 9.0.6926 SP-3

In Access Help (not VBA help) I did a search for "wildcard" The page
that decribes that is first.

If I search in VBA it says "? Matches any single character."

Yes, now I see it in my copy of Access 2000. Since that help topic is
talking about finding data, I checked to see if the wildcard character
behaved differently in the Find dialog, but it doesn't -- '?' matches
any character, not just an alphabetic one.

What's more, more or less the same page, with the same error, appears in
the Access 2002 help, though in a different location. This is an error
in the help files, plain and simple.
 
So, I need to use the [A-Z] method.

Can I do the regex thing of [A-Za-z] to cover lower and uppercase?
 
SirPoonga said:
So, I need to use the [A-Z] method.

Can I do the regex thing of [A-Za-z] to cover lower and uppercase?

You can, but you wouldn't normally have to, since text comparisons are
case-insensitive by default. It would depend to some extent on where
you want to use it.
 

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

Back
Top