When I tried to perform the below code in SQL Server 2005 I am getting the error
Invalid column name DistanceFromAddress
Code:<
I think you can only use AS to display the final values. To do a comparision, the select should be returned from another select statement inside it.
Like:
SELECT a.disfromaddr FROM
( SELECT SQRT(POWER(cast(Program_Latitude as float) - cast('41.5126237' as float), 2) +
POWER(cast(Program_Longitude as float) - cast('-81.6516411' as float), 2)) * 62.1371192
AS DistanceFromAddress FROM tblProgram)
a WHERE a.disfromaddr < 2
You can try this.