Advertisement

12.07.2002 at 04:02PM PST, ID: 20418667
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Store Locator - calculating distance formula on database records and returning results

Asked by miamitons in ColdFusion Application Server

Tags: , , ,

The goal is a store locator whereby a user would enter their zip code and find the top 25 closest store locations. I have a table with the stores' information (incl zip codes). I also have a table with latitude and longitude references for every zip code.

The user would enter their zip code into a form. CFQUERY would find the lat and lon for that zip code (from the ZipCodes table). The next step is to calculate the distance between the user criteria and every record in the store table, and to sort the distances.

Here is the formula to compute distance between two sets of latitude and longitude:

<CFSET Distance = SQR((69.1*(Zip2Lat-Zip1Lat))*(69.1*(Zip2Lat-Zip1Lat))+(69.1*(Zip2Lon-Zip1Lon)*COS(Zip1Lat/57.3)*(69.1*(Zip2Lon-Zip1Lon)*COS(Zip1Lat/57.3))))>

The question is in how I would run the calculation for each record and return the results as if it were a query.

Here are the tables and pertinent fields I'm working with:

ZipCodes
-------------
ZipCodeID
ZipCodeZip
ZipCodeLatitude
ZipCodeLongitude

Dealers
-------------
DealerID
DealerName
DealerZip

****

Thanks.Start Free Trial
[+][-]12.07.2002 at 04:18PM PST, ID: 7548808

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.07.2002 at 04:50PM PST, ID: 7548869

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.07.2002 at 04:53PM PST, ID: 7548874

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.08.2002 at 09:53PM PST, ID: 7552605

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.09.2002 at 07:08AM PST, ID: 7554271

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: ColdFusion Application Server
Tags: distance, formula, calculate, store
Sign Up Now!
Solution Provided By: TallerMike
Participating Experts: 4
Solution Grade: A
 
 
[+][-]12.09.2002 at 07:09AM PST, ID: 7554280

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.09.2002 at 07:32AM PST, ID: 7554417

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.09.2002 at 08:24AM PST, ID: 7554707

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.09.2002 at 08:29AM PST, ID: 7554739

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.09.2002 at 08:40AM PST, ID: 7554805

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.09.2002 at 08:45AM PST, ID: 7554834

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.09.2002 at 08:52AM PST, ID: 7554862

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.05.2004 at 05:14PM PST, ID: 10048815

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44