R
Rob
I have 2 tables of locations with Latitude & Longitude coordinates. TableA has about 300 records. TableB has about 85,000 records. I would like to find all records in TableB that are within 1 mile of TableA sites.
Here is my query which keeps giving me the "at most one record can be returned by this subquery". Yes, I'm expecting there to be several records which are returned by the subquery. All I want is the SiteNumberDo you have any suggestions?
SELECT TableB.SiteNumber, TableB.Latitude, TableB.Longitude FROM TableB WHERE (((69.1733*(((Abs((SELECT Latitude FROM TableA))-Abs([TableB].[Latitude]))^2)+((Abs((SELECT Longitude FROM TableA))-Abs([TableB].[Longitude]))^2))^0.5)<1))
[Notes about calculations: I'm using the 69.1733 (assumption about average miles per degree for a perfectly round Earth) and the various square root functions to basically compute the hypotenuse of a fictional right triangle between the 2 points so I can compute the distance. Thanks Pythagoras.]
Thanks,
Rob
Here is my query which keeps giving me the "at most one record can be returned by this subquery". Yes, I'm expecting there to be several records which are returned by the subquery. All I want is the SiteNumberDo you have any suggestions?
SELECT TableB.SiteNumber, TableB.Latitude, TableB.Longitude FROM TableB WHERE (((69.1733*(((Abs((SELECT Latitude FROM TableA))-Abs([TableB].[Latitude]))^2)+((Abs((SELECT Longitude FROM TableA))-Abs([TableB].[Longitude]))^2))^0.5)<1))
[Notes about calculations: I'm using the 69.1733 (assumption about average miles per degree for a perfectly round Earth) and the various square root functions to basically compute the hypotenuse of a fictional right triangle between the 2 points so I can compute the distance. Thanks Pythagoras.]
Thanks,
Rob