This post relates to this one on zip code proximity -

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.

Select Zipcode, ZipDistance('49415') as Distance
From Zipcodes
Where Latitude = 'somenumber' And Longitude = 'somenumber'
Order By Distance
The Where clause I know ho to do - it's the function I've been beating my head against the wall on.