Store Locator

G

Guest

Hello

I'm trying to create a simple store locator for my website using an Access
database table. A customer would enter a zip code and the results would list
the stores in that area. I would like to list store withing +/- 50 zip codes
(ex. if a customer enters 35100, it would return stores having codes between
35050 and 35150). I'm using Frontpage 2000.

Thanks!
Tom
 
K

Kevin Spencer

You're welcome!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
K

Kevin Spencer

Please forgive my flippant reply from a few minutes ago. You didn't ask a
question. However, if you are looking for some direction as to how to
implement this, I can give you a few pointers:

First, there's nothing "simple" about what you want to do. Programming is
like figure skating. To the audience it looks easy. Just try to do it
yourself, and you find out how "simple" it really is!

Second, your requirements are incorrect. You can't identify the location of
a zip code simply by getting all zip codes having a number within 50 of the
search zip code. Here's how you do it: You get a database which contains
lat/long information about the post office in each zip code. In addition,
you must have a database of lat/long information about each store location.
Then you have to do a query that calculates the distance between the
lat/longs of the zipcode you're starting from, and the stores which are
nearby. This involves a bit of trigonometry, and can get tricky, as
measuring distances between lat/longs is measuring distances on an
ellipsoid, not a sphere. But there are plenty of references out there that
can provide the algorithms you need. The distance is the variable factor. A
user should be able to set a distance, and get results for that radius
around that zip code's lat/long.

Of course, we're talking about a custom web application here. Depending upon
what environment you're hosted on, this could be done using ASP (Windows) or
(most likely) PHP on Unix.

Finally, with a little luck, you might be able to Google a ready-made app
that does this.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
G

Guest

Kevin

My fault about not asking the question, I'm clearly doing too many things at
the same time...

I just got the zip lookup to work using the database results wizard. If a
customer enters 45300, all stores pull up that are located with that exact
code. I really just want to list stores that are generally "around" that zip
code, for example, +/- 25 or 50 codes. I know this isn't as precise as what
you described (which is very accurate), but really just need a basic lookup.
Is there a way to modify the Frontpage ASP code to pull zip codes within a
range (right now it's a 1:1 relationship).

Tom
 
K

Kevin Spencer

Is there a way to modify the Frontpage ASP code to pull zip codes within a
range (right now it's a 1:1 relationship).

No need to modify the DRW. Modify the query.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
G

Guest

Do you mean create a custom query in the DRW? The results right now are
simply coming from a table (field name of customer_zip), I'm not exactly sure
how to create a query that would expand the results by a given +/- 50 margin.
Would you have a sample query that I could look at and test using the data I
have? I'm not quite sure how to set this up.

Thanks
 
K

Kevin Spencer

SELECT * FROM myTable WHERE ZipCode BETWEEN (Your zip code - 50) AND (Your
Zip Code + 50)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
G

Guest

I entered the following statement in the DRW custom query (Final is my table
name and Customer_Zip is the zip code field):

SELECT * FROM Final WHERE Customer_Zip BETWEEN (Customer_Zip - 50) AND
(Customer_Zip + 50)

However, the results page lists all 425 customers in my table (regardless of
the zip code). Not sure where I'm going wrong here, the functionality seems
to be fine but it doesn't seem to be selecting customers based on zip. My
text field in on a page named storelocator.asp, which displays the results on
a second page, storelocator2.asp.

Thanks
 
?

=?Windows-1252?Q?Rob_Giordano_\=28Crash_Gordon=AE\

slightly ot.

this method wouldn't work if zips are not physically contigious would it?
we're assuming that 85260 is next to 85261 and it may not be.
 
M

Murray

I think that's right, but I have never deeply investigated zip assignments!
8)

--
Murray

in message slightly ot.

this method wouldn't work if zips are not physically contigious would it?
we're assuming that 85260 is next to 85261 and it may not be.
 
T

Thomas A. Rowe

See:
http://www.fastsite.com/

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
K

Kevin Spencer

SELECT * FROM Final WHERE Customer_Zip BETWEEN (Customer_Zip - 50) AND
(Customer_Zip + 50)

The problem is that you're comparing a ZipCode to itself (Customer_Zip to
Customer_Zip). Of course, all records will be returned, as every record is
within 50 of itself.

You have to compare Customer_Zip to the ZipCode that you want to search
against, from your form.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
?

=?Windows-1252?Q?Rob_Giordano_\=28Crash_Gordon=AE\

i think the only accurate way to do it would be with coordinates, as kevin mentioned earlier.

funny how simple things aren't.

i'd run into this trying to coordinate an online car pool feature for my son's high school...proved to be too daunting for the amount they were paying (zippo) :)
 
K

Kevin Spencer

Define "next to." Numerically, yes, 85260 is "next to" 85261.

Note: The physical order of the records is unimportant. The ordinal order of
the records is.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

in message slightly ot.

this method wouldn't work if zips are not physically contigious would it?
we're assuming that 85260 is next to 85261 and it may not be.
 
T

Thomas A. Rowe

Never assume that zipcodes are next to each other, because they are not.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


i think the only accurate way to do it would be with coordinates, as kevin mentioned earlier.

funny how simple things aren't.

i'd run into this trying to coordinate an online car pool feature for my son's high school...proved
to be too daunting for the amount they were paying (zippo) :)
 
T

Thomas A. Rowe

The physical city/area they are assigned to by the Post Office, so subtracting 50 from a zipcode
will not necessary return zipcodes that are nearby the zipcode entered.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
?

=?Windows-1252?Q?Rob_Giordano_\=28Crash_Gordon=AE\

what i mean is that 85260 is not necessarily physically located near 85261 (mileage-wise) so while they are numerically bracketted they might not be close to the user...so the only way it would be accurate is using map coordinates as you mentioned earlier.
 
K

Kevin Spencer

If, by "physically contiguous" you are referring to the lat/long location of
the zip codes, I already covered that, and explained the proper way to
calculate the proximity of other zip codes using lat/long and trig. He
declined.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

in message slightly ot.

this method wouldn't work if zips are not physically contigious would it?
we're assuming that 85260 is next to 85261 and it may not be.
 
G

Guest

My zip field is a text field - should it be numeric? Can it be done using the
first 3 digits - meaning, 33350 returns 33351, 33352, etc.?
 

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