Queries Queries Queies

2004-06-16 Thread Butch Zaccheo
Ok... this is my end goal. to bring back a list of zipcodes within a given radius and compare that list against a list if dealers addresses. Right now I query the zipcodes table and bring back a list of zipcodes within a given radius. I create an array and then loop through all zipcodes in the

RE: Queries Queries Queies

2004-06-16 Thread Barney Boisvert
Message- > From: Butch Zaccheo [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 16, 2004 5:01 PM > To: CF-Talk > Subject: Queries Queries Queies > > Ok... this is my end goal. to bring back a list of > zipcodes within a > given radius and compare that list agains

Re: Queries Queries Queies

2004-06-17 Thread Jochem van Dieten
First, move the distance calculation into a UDF. That already goes a long way to clean up your code: Distance(fromLat, fromLon, toLat, toLon) UDF: SQR(((69 * ($3 - $1))*(69 * ($3 - $1))) +  ((69 * ($4 - $2))*(69  * ($4 - $2 Obviously you need to tailor this to whatever SQL dialect your datab