Queries are not my strong point and I hate to ask but I would like to see if anyone here could write the basic code of the syntax for me. I have a single table that has a list of US geographic locations by LAT and LONG and I need a query to return all locations within 100 miles.
txtLong,txtLat,txtCity,txtState
-92.35781,36.329026,Mountain Home,AR
-98.69707,36.804875,Alva,OK
-98.28297,36.949448,Amorita,OK
-124.35756,42.813437,Sixes,OR
-123.01769,44.061057,Springfield,OR
-75.32755,39.890462,Folsom,PA
-75.20374,40.13477,Fort Washington,PA
-96.54327,31.752538,Tehuacana,TX
-98.10754,29.699844,Canyon Lake,TX
-98.17653,29.749204,Canyon Lake,TX
-97.60044,29.269305,Smiley,TX
-81.50071,37.677563,Sabine,WV
-81.21634,37.964622,Scarbro,WV
-80.86194,38.653616,Clem,WV
-80.79366,38.704457,Gassaway,WV
-90.70102,46.273618,Mellen,WI
-90.05754,46.183572,Mercer,WI
-91.81795,46.233591,Gordon,WI
I’m writing a logistics app for our internal users and this is the final component I need
2007-10-23
01:58:25
·
3 answers
·
asked by
Andrew H
1
in
Computers & Internet
➔ Programming & Design
Its messy but after a number of reseach, I found this derived and make this inline forumila:
((ACOS(((SIN(Latitude1*3.14159265358979 / 180)*SIN(Latitude2*3.14159265358979 / 180))+(COS(Latitude1*3.14159265358979 / 180)* COS(Latitude2*3.14159265358979 / 180))) *COS((Logitude1-Logitude2)*3.14159265358979 / 180)) * 180 / 3.14159265358979) * 60 * 1.1515)
2007-10-23
11:11:45 ·
update #1