SELECT 规划数据.标准小区名称, gongcan.标准小区名称, 规划数据.经度, 规划数据.纬度, gongcan.经度, gongcan.纬度, DistC([规划数据.经度],[规划数据.纬度],[gongcan.经度],[gongcan.纬度]) AS 距离
FROM gongcan, 规划数据
WHERE (((DistC([规划数据.经度],[规划数据.纬度],[gongcan.经度],[gongcan.纬度]))<1));
Function DistC(A1 As Double, B1 As Double, A2 As Double, B2 As Double) As Double
a = A1 - A2
B = B1 - B2
c = 8.72664625997165E-03 * (B1 + B2) '=(B1+B2)*PI/360
DistC = Sqr(B * B + (a * Cos(c)) ^ 2) * 111.194926644559
End Function