SELECT distinct city (3963.1 * ACOS( (SIN(RADIANS([source latitude])) * SIN(RADIANS(latitude))) + ( COS(RADIANS([source latitude])) * Cos(RADIANS(latitude)) * Cos(RADIANS([source longitude]) - RADIANS(longitude))))) AS distance, zip AS zip FROM zipcodes WHERE (3963.1 * ACOS( (SIN(RADIANS([source latitude])) * SIN(RADIANS(latitude))) + ( COS(RADIANS([source latitude])) * Cos(RADIANS(latitude)) * Cos(RADIANS([source latitude]) - RADIANS(longitude)))) < [radius])br> ORDER BY distance >Replace radius, source latitude, source longitude with the appropriate amounts, etc.
You might try the Web Service and see if you can get it done for free.
posted by madajb at 1:05 PM on May 4, 2006