Query on a range

DJM1216

Board Regular
Joined
Apr 15, 2002
Messages
102
'Evening everyone...

I have a table of all cities in a state with their valid zip codes. For example a record would have three columns, city name, low zip, high zip.

Anytown 11111 11125

I need to run a query on one zip (example 11120), is there a way to write a query to look at both zip columns and determine if the zip I'm querying on falls within those two values?

Please let me know if you need any further information....and thanks in advance for your help!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Just check the number against both columns, ie. >= 11120 in the first column and <= 11120 in the second.
You will probably want to set up a parameter in the query or call it from a form to avoid having to enter the zip code twice.

HTH

Peter
 
Upvote 0

Forum statistics

Threads
1,221,621
Messages
6,160,879
Members
451,675
Latest member
Parlapalli

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top