Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Determine Distance Between Any Two Locations Expand / Collapse
Author
Message
Posted Thursday, September 27, 2007 2:30 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, April 19, 2011 5:10 PM
Points: 275, Visits: 168
Comments posted to this topic are about the item Determine Distance Between Any Two Locations


Karen Gayda
MCP, MCSD, MCDBA

gaydaware.com
Post #403737
Posted Monday, June 09, 2008 1:50 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 09, 2008 1:48 PM
Points: 1, Visits: 4
Thanks alot for the clean and good function!!
Kind regards,
Wim
Post #513982
Posted Thursday, July 17, 2008 9:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 22, 2008 1:37 PM
Points: 1, Visits: 4
There is one issue in the CalcDistanceBetweenGeoLocations function. Sometime you will get an error, "A domain error occurred.", by passing in some specific parameters.

So I added the following Code:
--reset @Distance if it is out of the range of (-1,1)
If @Distance>1
set @Distance=1
If @Distance<-1
set @Distance=-1
before
--Get distance in miles
SET @Distance = (DEGREES(ACOS(@Distance))) * 69.09

Because ACOS can be only with a value from -1 through 1.
Post #536101
Posted Monday, October 13, 2008 5:58 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, April 19, 2011 5:10 PM
Points: 275, Visits: 168
jgao,

Thanks for pointing that out.



Karen Gayda
MCP, MCSD, MCDBA

gaydaware.com
Post #585157
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse