wildcard in a parameter querie

  • Thread starter Thread starter lynn atkinson
  • Start date Start date
L

lynn atkinson

Can I use a wild card in a parameter query? I want to find
all the matches for "aberdeen" in a field, but this field
can also have other locations in it. This field is a
parameter in a query. I have tried entering *aberdeen;
*aberdeen* but these return no records. If I just enter
aberdeen, then that works but doesnt bring up the record
which has other locations in the text field as well as
Aberdeen.

Hope this makes sense! Can anyone help?
 
Try
SELECT Field1, Field2
FROM Table1
WHERE (((Field2) Like "*" & [enter] & "*"));

HTH
[enter] = the prompt that you want for the query
 
This parameter value was posted for another question:

[EnterPartialRef#] & "*"
You need the LIKE operator - by default Access uses = which ignores
wildcards.

LIKE "*" & [Enter partial ref:] & "*"

will find the search term anywhere within the field.
 
Back
Top