Create a query to search for ****** in text not wildcard

K

Kay

Hi
I am trying to create a query that searches a field for specifically
*******, not wildcard
I am running Access2000
Thanks
 
G

Guest

Are you specifically searching for 7 characters or would you just like for
the query to pick up the keyword you enter into the field?

If it is the latter, you can use the following:

Like "*" & [forms]![FormNamehere]![FieldValueNameHere] & "*"
 
J

John W. Vinson

Hi
I am trying to create a query that searches a field for specifically
*******, not wildcard
I am running Access2000
Thanks

The LIKE operator uses wildcards such as *; the = operator does not.

If you're searching for seven asterisks as the actual content of the
field simply use that as a criterion:

"*******"

on the Criteria line. In SQL it would be

WHERE ([fieldname] = "*******")


John W. Vinson [MVP]
 
G

Guest

Do you mean where the field contains a literal string of seven asterisks?

If so and the string is the complete value in the field then simply use the
equality operator:

SELECT *
FROM [MyTable]
WHERE [MyField] = "*******";

If the seven asterisks are a substring within the field then use the INSTR
function:

SELECT *
FROM [MyTable]
WHERE INSTR([MyField],"*******") > 0;

Ken Sheridan
Stafford, England
 

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

Top