Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Distance with Longitude/Latitude 1

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I'm using CR2011 with a SQL Server db as my data source. I am trying to calculate the distance between a mobile phone customer hailing a cab and the cab itself, and I have the longitude and latitude of both driver and passenger. Is there any way to calculate distances using long/lat in Crystal??
 
I don't think you can do this in Crystal. What is the SQLServer version ?

Viewer, scheduler and report manager for Crystal reports and SSRS.
Send your report everywhere.
 
I will take this back . Check if this sample will work for you :


If SQLServer is 2008 you can use geography. Here is an example how you do the calulation in SQLServer 2008 and with previous versions:


Viewer, scheduler and report manager for Crystal reports and SSRS.
Send your report everywhere.
 
Thanks Rtag for the link to the sample code. It worked great!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top