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

  • Thread starter Thread starter Kay
  • Start date Start date
K

Kay

Hi
I am trying to create a query that searches a field for specifically
*******, not wildcard
I am running Access2000
Thanks
 
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] & "*"
 
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]
 
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
 
Back
Top