So I have a table with a bunch of different addresses in it. I need a proc that will select the addresses in that table that are within a specified distance in miles from the passed in lat/long values.
So example of my table:
- messageId
- lat (float)
- long (float)
Proc is passing in another lat/long pair (both floats as well) as well as an int (miles)
I found this http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81360 to calculate the actual formula but I can't figure out to modify it in proc form to be able to go through an entire list of addresses and only give me the Id's of the addresses that are <= the miles (that I pass in), from the lat/long I pass in.
Can I get any help here?
Thanks!