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