Parameter Query

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

Guest

I have a query that is supposed to look at a table and give me the results
for all the entries containing at least "name".

ex. All the entries containing Bob Smith, whether it be just Bob Smith or
Bob Smith / Al Johns. I know I can use Like "*Smith*" in a straight query
but I want the query to ask me for the name to include so that I can ask for
all the Smith entries or all the Johns entries.

If that makes sense and you have any suggestions, please help me out.

Thanks

David
 
In the criteria you want to "stub" a "*" to the perameter part. Here i"m
trying to find WILDCARD&[Question]

SELECT ST.StockNumber, ST.LocationNumber, ST.StockDescription1
FROM ST
WHERE (((ST.StockDescription1) Like "*" & [Perameter Question]));

It asks the uestion, I load STUD, and I get ABC STUD, STUD, STUD ABC, aSTUD,
etc..

HTH
 
Criteria: LIKE "*" & [Enter Name to Match] & "*"
Then you just type "Smith" to match "Smith" anywhere in the field.

Or you could use
Criteria: LIKE [Enter Name to Match]
and enter the wildcards yourself, if you wanted more control over the
matching process. Then you would type
"Smith*" to match "Smith" at the beginning
"*Smith" to match "Smith" at the end
"*Smith*" to match "Smith" anywhere in the field
etc.
 
Thanks. One question as I am new to this, what is the "ST"? "Stocknumber" is
the Field correct?

Does the whole thing from Select through [Parameter Question])) go as the
criteria?

thanks

David


Dirtbike said:
In the criteria you want to "stub" a "*" to the perameter part. Here i"m
trying to find WILDCARD&[Question]

SELECT ST.StockNumber, ST.LocationNumber, ST.StockDescription1
FROM ST
WHERE (((ST.StockDescription1) Like "*" & [Perameter Question]));

It asks the uestion, I load STUD, and I get ABC STUD, STUD, STUD ABC, aSTUD,
etc..

HTH

DDrowe said:
I have a query that is supposed to look at a table and give me the results
for all the entries containing at least "name".

ex. All the entries containing Bob Smith, whether it be just Bob Smith or
Bob Smith / Al Johns. I know I can use Like "*Smith*" in a straight query
but I want the query to ask me for the name to include so that I can ask for
all the Smith entries or all the Johns entries.

If that makes sense and you have any suggestions, please help me out.

Thanks

David
 
Yes, Yes..and what John Spencer said..

DDrowe said:
Thanks. One question as I am new to this, what is the "ST"? "Stocknumber" is
the Field correct?

Does the whole thing from Select through [Parameter Question])) go as the
criteria?

thanks

David


Dirtbike said:
In the criteria you want to "stub" a "*" to the perameter part. Here i"m
trying to find WILDCARD&[Question]

SELECT ST.StockNumber, ST.LocationNumber, ST.StockDescription1
FROM ST
WHERE (((ST.StockDescription1) Like "*" & [Perameter Question]));

It asks the uestion, I load STUD, and I get ABC STUD, STUD, STUD ABC, aSTUD,
etc..

HTH

DDrowe said:
I have a query that is supposed to look at a table and give me the results
for all the entries containing at least "name".

ex. All the entries containing Bob Smith, whether it be just Bob Smith or
Bob Smith / Al Johns. I know I can use Like "*Smith*" in a straight query
but I want the query to ask me for the name to include so that I can ask for
all the Smith entries or all the Johns entries.

If that makes sense and you have any suggestions, please help me out.

Thanks

David
 

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

Back
Top