Zipcode lookup by proximity...

Discussion in 'ASP General' started by William Morris, Jun 9, 2004.

  1. 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
    William Morris, Jun 9, 2004
    1. Advertisements

  2. William Morris

    Steven Burn Guest

    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



    Steven Burn
    Ur I.T. Mate Group

    Keeping it FREE!
    Steven Burn, Jun 9, 2004
    1. Advertisements

  3. 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.
    Aaron [SQL Server MVP], Jun 10, 2004
  4. Precisely what I was looking for. Thank you, Aaron. I don't suppose you
    have any links handy, or the formula?

    - Wm
    William Morris, Jun 10, 2004
  5. William Morris

    James Baker Guest

    James Baker, Jun 10, 2004
  6. Aaron [SQL Server MVP], Jun 10, 2004
  7. 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
    William Morris, Jun 10, 2004
  8. 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. ;-)
    Aaron [SQL Server MVP], Jun 10, 2004
  9. Aaron [SQL Server MVP], Jun 11, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.