What exactly is the 111 supposed to do in the formula?  (Uncommon Valor
comes to mind...)

And why are you sure it has something to do with it?


-----Original Message-----
From: Phillip B [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 25, 2003 15:06
To: SQL
Subject: zipcode search problem

I read the zip code radius article here http://tutorial153.easycfm.com/
. I
can now query the database and get records back but not within the
specified
miles. I'm sure it has something to do with this part of the statement.
(#form.passedradius#/111) Any ideas of what I need to change?

SELECT zip, lat, long, state, city,
ROUND((ACOS((SIN(#passedzip.lat#/57.2958) * SIN(lat/57.2958)) +
(COS(#passedzip.lat#/57.2958) * COS(lat/57.2958) *
COS(long/57.2958 - #passedzip.long#/57.2958))))
* 3963, 1) AS distance
FROM zips
WHERE (lat >= #passedzip.lat# - (#form.passedradius#/111))
And (lat <= #passedzip.lat# + (#form.passedradius#/111))
AND (long >= #passedzip.long# - (#form.passedradius#/111))
AND (long <= #passedzip.long# + (#form.passedradius#/111))
ORDER BY distance


Phillip B.

www.LoungeRoyale.com
www.FillWorks.com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:6
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:>

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                        

Reply via email to