Searching on first 5 characters in a field

  • Thread starter Thread starter REGREGL
  • Start date Start date
R

REGREGL

Hello all.

I would like to create a query which returns phone number records that match
the first 5 characters submitted. The idea being to show customers which
have similar telephone numbers to the one being queried. Any ideas on how I
can do this?
 
Hello all.

I would like to create a query which returns phone number records that match
the first 5 characters submitted. The idea being to show customers which
have similar telephone numbers to the one being queried. Any ideas on how I
can do this?

As criteria on the Phone field, write:
Like [Enter first 5 numbers] & "*"
 
Create a new query in design view.

Add the table.

Add the field.

In the Selection Criterion "cell" under the field, add:
Like [Enter the first 5 characters] & *

Save and run the query.

This query will prompt the person running it to provide a "starts with"
search string and then find anything in the field that starts with those
characters. Note that it is not (and need not be) limited to 5 characters.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks!!! That should work fine! Why didn't I think of that?

Jeff Boyce said:
Create a new query in design view.

Add the table.

Add the field.

In the Selection Criterion "cell" under the field, add:
Like [Enter the first 5 characters] & *

Save and run the query.

This query will prompt the person running it to provide a "starts with"
search string and then find anything in the field that starts with those
characters. Note that it is not (and need not be) limited to 5 characters.

Regards

Jeff Boyce
Microsoft Office/Access MVP

REGREGL said:
Hello all.

I would like to create a query which returns phone number records that
match
the first 5 characters submitted. The idea being to show customers which
have similar telephone numbers to the one being queried. Any ideas on how
I
can do this?
 

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