I've got a db full of pretty geo locations. lng and lat's, the question is. I've found a nifty little sql select that will help me compare the geo locations, and pick the ones from my DB that are the closests, but im afraid i need to use my current geo location to find out which is nearest, so how would i go about putting it into the SQL selection?
Code below is the ' nifty ' select.
SELECT latitude, longitude, SQRT(
POW(69.1 * (latitude - [startlat]), 2) +
POW(69.1 * ([startlng] - longitude) * COS(latitude / 57.3), 2)) AS distance
FROM TableName HAVING distance < 25 ORDER BY distance;