Hy Jann, Thanks for your feedback, yes its much better to let the DB do the processing.
Would you mind sharing that sql code in your stored procedure? I just purchased a brand new DB of zipcodes, if you need an updated version, let me know. I need to display results like this for a real estate agents database: Realtor A - Phone - Zipcode - Distance Realtor B - Phone - Zipcode - Distance Realtor C - Phone - Zipcode - Distance The realtors closest to the search zipcode show up at top, the ones farthest at bottom. So the results are sorted by distance. Thanks, Pardeep. ----- Original Message ----- From: "Jann E. VanOver" <[EMAIL PROTECTED]> To: "SQL" <[email protected]> Sent: Wednesday, February 23, 2005 5:18 PM Subject: Re: Zipcode radius sqlcode > FYI, the accuracy of your distance calculations is dependant on the > number of decimal places in your Zipcode data. > > I know this because I work with zip code tables with 6 digits of > precision, and the distances I can compute with those are VERY > inaccurate. They're all relatively correct, they're just not right. > > I've put my code into a stored procedure so I can link the zips with the > tables that define the retailers I'm covering. That way the relation > between Zip distance and Retailer location can be done inside SQLServer > before sending anything back to CF. > > > J > > [EMAIL PROTECTED] wrote: > > >Hi Michael, > > > >I found one tag that does the radius search and returns two vars: > > > >1. Zipsreturned (all the zips that match) > >2. Distancereturned (all the distances between the search zip and zipz that > >fall in the radius) > > > >Then I have a table called realtors, and I run a query like: > > > >select * > >from realtors > >where zipcode IN #zipsreturned# > > > >Now the question I wanted to ask is, how do I relate the distance to the > >right realtor based on the realtors zipcode? > > > >Both zipsreturned and distance returned are lists in the same order. > > > >Take care, > >Pardeep. > > > > > >----- Original Message ----- > >From: "Michael T. Tangorre" <[EMAIL PROTECTED]> > >To: "SQL" <[email protected]> > >Sent: Wednesday, February 23, 2005 4:28 PM > >Subject: RE: Zipcode radius sqlcode > > > > > > > > > >>You are going to have to do two things: get a database or CSV or flatfile > >> > >> > >of > > > > > >>zipcodes, along with latitude and longitude coordinates. Then google "SQL > >>Zipcode Distance formula" or search the "cf-talk" archives (it was just > >>talked about last week). That should get you going. > >> > >> > >>Michael T. Tangorre > >> > >> > >> > >> > >> > >>>-----Original Message----- > >>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >>>Sent: Wednesday, February 23, 2005 7:28 PM > >>>To: SQL > >>>Subject: Zipcode radius sqlcode > >>> > >>>Does anyone know of a good zipcode radius search solution or > >>>sql code to pull this off? > >>> > >>>I need to do a search of realtors by zipcode or phone area > >>>code, and then show the resulting realtors who match, while > >>>also showing the distance each one is from the zipcode the > >>>search was applied on. > >>> > >>>Thanks, > >>>Pardeep. > >>> > >>> > >>> > >>> > >>> > >> > >> > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2166 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
