Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Telephone number partial query

45 views
Skip to first unread message

tema...@gmail.com

unread,
Aug 9, 2018, 3:31:50 PM8/9/18
to
I am a relative beginner in access, but can usually find my way around pretty good. However, i have been having trouble with this one. I am trying to get a query to pull back all records that contain a partial telephone number. For example, if i know a number is 5551212, i want the query to pull back everything that shows 14045551212, 17065551212, etc... along with the additional info in the table for that number. The user has a table where they can put their number in, click a button to run the query and pull back the complete number. Right now, you have to know the 10 digit number to pull back the data in the other table. I am trying to allow them to just be able to put in a partial number. The enter a number table is joined to the data table. I am sure this is a simple solution i am just missing, so any help would be great.

Ron Weiner

unread,
Aug 9, 2018, 5:08:24 PM8/9/18
to
tema...@gmail.com formulated on Thursday :
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com

Use the WildCard Character * for many and ? for One character.

SELECT This, That, TheOther FROM YourTable WHERE Phone Like '*5551212'
ORDER BY whatever

That will return all if the Phone Numbers that end in 5551212

Rdub

Ulrich Möller

unread,
Aug 9, 2018, 5:13:24 PM8/9/18
to
Hi,

Am 09.08.2018 um 21:31 schrieb tema...@gmail.com:
> I am a relative beginner in access, but can usually find my way around pretty good. However, i have been having trouble with this one. I am trying to get a query to pull back all records that contain a partial telephone number. For example, if i know a number is 5551212, i want the query to pull back everything that shows 14045551212, 17065551212, etc... along with the additional info in the table for that number. The user has a table where they can put their number in, click a button to run the query and pull back the complete number. Right now, you have to know the 10 digit number to pull back the data in the other table. I am trying to allow them to just be able to put in a partial number. The enter a number table is joined to the data table. I am sure this is a simple solution i am just missing, so any help would be great.

There is a like operator for searching with wildcards in a query.
See
https://www.w3schools.com/sql/sql_like.asp
https://msdn.microsoft.com/en-us/library/bb208897(v=office.12).aspx

Ulrich
0 new messages