Wildcard in query

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.
 
G

Guest

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] & "*"
 
G

ginnyk

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*";
 

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