SQL Server doesn't support an exponent operator (^), so you'll need to use either the POWER or EXP function instead. Also, some of your parentheses seemed to be off, so try this:
2 * asin(sqrt( power(sin((lat1-lat2)/2),2) + cos(lat1) * cos(lat2) * power(sin((lon1-lon2)/2),2) ) ) In the future, you may want to try the HoF SQL mailing list for a faster response. Dina On 12/2/05, Ken <[EMAIL PROTECTED]> wrote: > Hi. I want to use this in one of my stored procedures. Can anyone correct > the syntax here for me please. The formula i want to use is: > > 2*asin(sqrt((sin((lat1-lat2)/2))^2 + > cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2))^2)) > > Thanks, > K > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226049 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54