Wildcard in query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use a wildcard in a query criteria. I have tool numbers, for
example:

Tool #
9537-57
6-2223-42
276150 0021
276150 0033

I would like to write a query that will select the two tool numbers with the
276150 beginning. Please help.

Thank you.
 
Try using Like in the query

Select * From TableName Where [Tool #] Like [Please enter a part number] & "*"

When running the query, the user will be prompt to enter a part number
If you want to search for a part of the string any where in the part number,
then use

Select * From TableName Where [Tool #] Like "*" & [Please enter a part
number] & "*"
 
Steve said:
I am trying to use a wildcard in a query criteria. I have tool numbers, for
example:

Tool #
9537-57
6-2223-42
276150 0021
276150 0033

I would like to write a query that will select the two tool numbers with the
276150 beginning. Please help.

Thank you.

Use the 'Like' keyword, rather than an equal sign.
Select Tool FROM Tools WHERE Tool# Like "276150*";
 
Back
Top