views:

234

answers:

1

I have a table with the geography type and I want to run a query to find all rows within 25 miles of a specific lat/long. What would the query look like to accomplish this?

+1  A: 

This is how I did it:

select *
from local_events
where _your_geography_column_.STDistance(geography::Point(_your_lat_,_your_long_, 4326)) < ((_your_miles_ * 1000) * 0.621371192)
Chris Stewart

related questions