Dan, This is a piece of cake if you have GIS available. In your case, you can download files with the centroid for each zip code from sites, such as this:
http://www.census.gov/geo/www/tiger/zip1999.zip It comes as a Word Document and a DBF database. I believe the Post Office also has files you can download at no cost. You can simplify the calculation dramatically if you ignore earth's curvature and assume a straight line between centroids. Since you are not looking at large distances the difference should not be too bad. I am sure that you can download freeware calculators that would do the calculations including all factors. One item that you need to consider is whether you want a straight line distance or a driving distance; the difference between these two approaches could be large. You can also create an expression and pass it on to Google (if Internet is available) and let Google (or any mapping service) do the work for you. Javier, Javier Valencia 913-915-3137 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Dan Goldberg Sent: Tuesday, August 11, 2009 1:06 PM To: RBASE-L Mailing List Subject: [RBASE-L] - SOT: zip codes I am investigating on how to find the nearest zip code from another zip code based on distance. I am working on a dealer locator solution. I was wondering if anybody else has done this in Rbase. I am thinking there is an additional data field needed to determine the physical location(maybe latitude and longitude??). I am not sure. I know there are hosted solutions but I am looking for an in house solution to save some $$$. TIA Dan Goldberg

