Zipcode lookup by proximity...

W

William Morris

Looking for a source for data and/or algorithm that would allow me to enter
a zipcode and find - in our case - every car dealership that sells, say,
Chevy's in that zipcode - if not there, then what about adjacent
zipcodes..? - in an ever expanding circle outward, and return a list of
those zipcodes.

In my database, I've already got the car dealers and available makes. What
I need is the zipcode "map" reference. Ideas, sources?

- Wm
 
S

Steven Burn

If you've already got the info in the database, then all you need to do is
select from it, based on certain parameters. For example;

strManufacterer = "Ferrari"
strModel = "F50"
strZipCode = "119911"

rst.Open "Select Model From tblCars Where Zip = '" & strZipCode _
& "' and Manufacterer = '" & strManufacterer & "' and model =
'" & _
strModel & "'", DB, adOpenStatic, adLockPessimistic

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
A

Aaron [SQL Server MVP]

You will need a zip code -> lat / long database. You can find some free
ones out there, but the quality isn't very good (you get what you pay for).
There is a mathematical formula that will tell you the distance between two
points, given the lat/long of each. So, you take the dealer's zip code,
find the lat and long, then you have a function or procedure that finds all
the zip codes where (formula) < 5 miles.
 
W

William Morris

Precisely what I was looking for. Thank you, Aaron. I don't suppose you
have any links handy, or the formula?

- Wm
 
W

William Morris

Actually, we are using SQL Server. The links are great, too. Our list is
small enough at this point that listing every dealer on one page is a
perfectly acceptable solution for the next few months, so, yeah, it can
wait. This'll give me something I can take to the next planning meeting and
hopefully buy myself some time.

- Wm
 
A

Aaron [SQL Server MVP]

FYI, "about to" in this specific case means either tonight (time permitting)
or early next week. I had already worked on a similar solution for a
client, and adapting that work slightly will make for a good, workable
example that can be used for similar scenarios.

For future reference, my "about to" has various meanings, given context,
mood, schedule, and level of effort. ;-)
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top