View Full Version : How to search for "contains"


zhuanyi
04-26-2007, 11:18 AM
Say I have a field that contains data like:
abba
abc
ccdd

And I would like to inlude, say, just a single b if the word starts with a and ends with c (i.e., abc or abdc are both OK), and any number of bs if the word starts with a and ends with a(i.e., like abbbbbbbbbbbbbbba or abbbbbbdda) and so on.
how can I do that?

Thanks!

Anyi

KeithG
04-26-2007, 12:23 PM
You can use the * as a wild card.

So if you used *b* this would return every row with a b in it. Is this what you want?

zhuanyi
04-26-2007, 12:24 PM
But what if i could only allow one characters instead of multiple character? What would be the wildcard then?
thanks!

KeithG
04-26-2007, 12:46 PM
I believe you would use ? as a wildcard. Look up Wildcard in Access help

modest
04-27-2007, 06:42 AM
Keith is correct.

* - evaluate any number of characters or symbols (or lack of)
? - evaluate a particular character
# - evaluate a single numerical digit
[] - evaluate a character in a range (ex. [A-Z] checks for a character in the alphabet)
[!] - evaluate a character not in a range (ex. [!A-Z] only allows characters not in alphabet)