March 11, 2010 at 7:02 pm
how do i write this equation in sql query in a column
All of these field names have numerical values: Xa, Ya and Xb, Yb. Now what pythagoras says is that:
distance = square-root ( (Xb-Xa)2 + (Yb - Ya)2 )
The Problem is that writing this as query with "Distance" AS an EXPression. However the SQL server does not allow the "2" included in the equation throwing errors each time spitting back the 2's which are 'the quare root of' and important part in the value im trying to get.
March 11, 2010 at 7:25 pm
You might want to check out the POWER and SQRT functions in BOL.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 11, 2010 at 7:39 pm
Thank y:Wow:u,
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply