Select Records that fall in an external set of ranges (subquery)

  • Thread starter Thread starter Orange Clare
  • Start date Start date
O

Orange Clare

Hi

I have not done subqueries before so I am a bit confused. I have two
tables

1 - Phone Numbers - (converted to be numeric) (with other fields for
later) and
2 - Exchange codes - multiple entries for code with 3 fields -
Exchange name (duplication) - Start Range and End Range.

I want to return a list of phone numbers that fall into the range for
a certain exchange.

For example - MRSPOO has 4 entries in the Exchange Table with 4
distinct ranges. 200-299, 307-788, 997-1102 and 2036-6698.

I would like to be able to return all the phone numbers for a single
exchange code that I would select (using a query or a form)

Please can you help.
 
I'm struggling to understand the data in the examples.

The ranges such as:
200 - 299
are prefixes? So a phone number such as 202 5000 fits in that range? But you
also have 4-digit prefixes? So 203 6777 fits in a *different* range? That
seems inconsistent.

Do some phone numbers contain more digits than others?
 
I'm struggling to understand the data in the examples.

The ranges such as:
200 - 299
are prefixes? So a phone number such as 202 5000 fits in that range? But you
also have 4-digit prefixes? So 203 6777 fits in a *different* range? That
seems inconsistent.

Do some phone numbers contain more digits than others?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.












- Show quoted text -

Hi Allen

The 3-4 digit numbers are a simplification. We have 10 or 11 digit
numbers to deal with and they are not all prefixes. They are separate
ranges.

HTH
Clare
 
Back
Top