AccuGeoCoder Module: Calculate Distance in a script
Below you'll find a Command that will calculate the distance between a Single Point and All Records in your database that contain an eLatitude and eLongitude coordinate. This is for use with the AccuGeoCoder Module.
You only have to enter the Starting Latitude and Longitude in the command and click Run.
Note: Run AFTER Validating with Lat/Long checked or processing the list using the AccuGeocoder Module.
*!* Field Names *!* Starting Latitude Value *!* Starting Longitude Value *!* Supress Messages *!* Add Distance Field *!* Convert Latitude ON ERROR com_ReplaceString="REPLACE ALL &com_DistanceField WITH iif(!EMPTY(&com_LatitudeField) AND !EMPTY(&com_LongitudeField),round(3958.75*acos(sin("+calc_Lat+")*sin(val(&com_LatitudeField)/57.2958)+cos("+calc_Lat+")*cos(val(&com_LatitudeField)/57.2958)*cos(val(&com_LongitudeField)/57.2958-"+calc_Long+")),15),0)" &com_ReplaceString |