How to Query Incomplete Phone Numbers?

L

lavenderfleur

I have a basic database containing student records. I would like to be
able to query incomplete phone numbers. Is there a simple way to do
this? By the way, some of the phone numbers will have the area code,
some will not, some have no phone number at all. This is information
that I am pulling from another program. Thanks!
 
J

John Spencer

It depends on how the phone numbers are stored and whether they are all a
standard length

IF all phone numbers are entered as
123-4567 or 123 456-7890 Or they use spaces or dashes or dots in the same
pattern then you could use the following to get all the incomplete

Field: PhoneLength: Len(TRIM([Phone Number Field] & ""))
Criteria: Not IN (8,12)

Another method that might work would be
Field: [Phone Number Field]
Criteria: NOT LIKE "*###*####" Or Is Null
 
K

kingston via AccessMonster.com

I'm not sure I understand so here are two possible solutions.

Use a parameter query with wildcards.
For the field Telephone, use the criteria:
Like "*" & [Search String] & "*"

Use a query to check the length of the telephone number.
New Field: Len([Telephone])
Criteria: Is Null OR (<>10 AND <>7)
 
L

lavenderfleur

Thank you both for the reply. Using the NOT LIKE *###*#### worked
great! I appreciate it!
 

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