Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
knudmt
Starting Member
12 Posts |
Posted - 2010-04-22 : 12:07:51
|
| Hello I am trying to use the distance formula in sql to show the distance between all locations in two tables. but when I do so it throws me an error: POW is not a built-in functionhere is my statementSELECT p.poiAID, p.poiBID, SQRT(POW(a.GPSLat - b.GPSLat, 2) + POW(a.GPSLon - b.GPSLon, 2)) AS distanceFROM tblPaths pJOIN tblPointOfInterest aON p.poiAID = a.IDJOIN tblPointOfInterest bON p.poiBID = b.IDAny suggestions? |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-04-22 : 12:21:23
|
| R u trying to do power of Eg: 2 to power of 2 = 4In that case use Power and not Pow. |
 |
|
|
knudmt
Starting Member
12 Posts |
Posted - 2010-04-22 : 13:42:23
|
| YES THAT DID IT!! thank you so much! This is honestly one of the best forums I have ever used. You have no idea how much this has helped me! Thanks again you are a life saver! |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-04-22 : 23:56:56
|
You are welcome I am here to learn from Masters and help new bees in learning. |
 |
|
|
|
|
|