Forum Discussion

SarahBurres's avatar
SarahBurres
Qrew Trainee
6 years ago

distance between two addresses

I am trying to calculate the distance between two addresses.  I put the below formula in but came up with a distance of 5000 and it should be 3. 

var number OriginLat = [LatitudeVendor];
var number OriginLong = [LongitudeVendor];
var number DestLat = [LatitudePlant];
var number DestLong = [LongitudePlant];
var number Distance = Round(((69*($OriginLat - $DestLat))^2 + (53*($OriginLong - $DestLong))^2)^0.5);

If($OriginLat =0 or $DestLat=0,0,$Distance)



------------------------------
Sarah Burres
------------------------------

18 Replies

  • Your screen shot shows in fact 1,547 miles not 5,000.  It's impossible with the coordinates in the screen shot to only be three miles apart.  They are very far apart as they are very different.  I think that your source data is incorrect.  

    "My" formula is correct.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------