I need to find a way i can type a zipcode like 33308 and get all the zipcodes around it like 100 miles
any one where i can get a script like this?
I doubt you can find it, but give http://www.cflib.org/ a look. They MIGHT have it.
Here is a script that I use all the time but you need to find a zip code database with latitudes and longitudes. Google it and you'll find it. This script will work with SQL database, access db may be bit different due to math.
<cfquery name="passedzip" datasource="db" maxrows="1">
SELECT zipcode, latitude, longitude FROM ZIPCODERADIUS
WHERE ZIPcode >= '#zip#'
<cfquery datasource="db" name="getZip" >
WHERE 3963 * (ACOS((SIN(round(#passedzip.latitude#,3)/57.2958) * SIN(latitude/57.2958)) +
(COS(round(#passedzip.latitude#,3)/57.2958) * COS(latitude/57.2958) *
COS(longitude/57.2958 - round(#passedzip.longitude#,3)/57.2958)))) <= #URL.radius#
ORDER BY zipcode
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)