Hi,
I have written a query to fetch data from database.The query fetches addresses that are with in a certain distances .But i am getting the error like this Arithematic overflow error when converting nvarchar to datatype numeric.
Heres the query
SELECT Street_Address as title, Latitude as lat, Longitude as lng,Street_Address as
description,SQRT(POWER(Latitude - 8.4874949, 2) + POWER(Longitude - 76.9486230,
2))*62.1371192 AS DistanceFromAddress FROM dbo.tblOrganization_Address WHERE
(ABS(Latitude - 8.4874949) < 0.25) AND(ABS(Longitude - 76.9486230)< 0.25) ORDER BY DistanceFromAddress
I have given the fields Latitude and Longitude as nvarchar(50)
in the dbo.tblOrganization_Address.