Can I use 'Like' or '*' operater is a parameter query?

N

nosaj_enryb

All,

I have set up a parameter query but I was wondering if it is possible to
retrieve results when I only put in a part of the field.

e.g. Column one contains peoples full names. I want to do a search on this
using parameter queries that will display all names with 'John' in them. So
if I type in John when prompted by parameter, it will give me John Murphy,
John Smith, John Brown etc?

Is there anyway to do this without adding anpother field to my database>

Help would be great>

Jason
 
F

fredg

All,

I have set up a parameter query but I was wondering if it is possible to
retrieve results when I only put in a part of the field.

e.g. Column one contains peoples full names. I want to do a search on this
using parameter queries that will display all names with 'John' in them. So
if I type in John when prompted by parameter, it will give me John Murphy,
John Smith, John Brown etc?

Is there anyway to do this without adding anpother field to my database>

Help would be great>

Jason

To return records where your entry is the start of the field:
Like [Enter start of name] & "*"

To return records where your entry is anywhere in the field:
Like "*" & [Enter part of the name] & "*"

Note: It is poor design to have a full name in one field.
Searching for "John" in a FullName field will also return last names
like Johnson, Johns, etc., which is not what you wanted.

Better design would be to have a separate FirstName and LastName
fields. It's much simpler to put the two names together when needed
than to separated them. Searching a FirstName field for John will not
return Johnson, nor Johns, unless that is someone's first name.
 

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