Cheers for posting your solution - I was encountering exactly the same problem and was getting very frustrated. However I think you'll find that if you round to 15 decimal places instead of 3 you'll get much better results (rounding to 16 places and above will result in the error re-occurring). I've been doing a nearby / proximity search using this calculation myself and get quite different results depending upon how many decimal places I round to.
So for anyone who just wants to copy and paste, use this instead: SET @distance = @EarthRadius * ACOS(ROUND( (SIN(RADIANS(@fromLatitude)) * SIN(RADIANS(@toLatitude))) + (COS(RADIANS(@fromLatitude)) * COS(RADIANS(@toLatitude)) * COS(RADIANS(@toLongitude) - RADIANS(@fromLongitude))),15)) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---