Changes for adding distance

Made changes to the SQL , using formula for distance added a new field and added a order by clause to the SQL.

Also, added a new field for displaying