This post relates to this one on zip code proximity - http://www.sitepoint.com/forums/showthread.php?t=157759
I was able to get this working correctly so that a user can plug in a zip code and a radius and see all the zip codes that fall in the radius. But what I would love to have is a custom function that when I run the query I also get the distance between the zip code I am looking up and the ones it returns.
The Where clause I know ho to do - it's the function I've been beating my head against the wall on.
Select Zipcode, ZipDistance('49415') as Distance
Where Latitude = 'somenumber' And Longitude = 'somenumber'
Order By Distance