Hi all. I have 2 tables and I'm using VFP 9.
Tbl1 fields/records
name1, naddress, nlatitude, nlongitude, etc
name2, naddress, nlatitude, nlongitude, etc
Tbl2 fields/records
StoreName1, sAddress, slatitude, slongitude, etc
StoreName2, sAddress, slatitude, slongitude, etc
I want to find up to six records in tbl2 that are up to 5 miles in distance from records in Tbl1 based on the latitude and longitude, and then append them to that record in Tbl1 by distance order.
Fox example, if a record from Tbl1 has a "123 Anywhere St, Los Angeles, CA 90001" address, I want up to 6 records from Tbl2 that are within 5 miles of distance, and then appended to Tbl1 in distance order. My end result would be:
name1, naddress, nLatitude, nLongitude, StoreName1, sAddress, StoreName2, sAddress, StoreName3, sAddress, and so on, up to six storenames.
I've never worked with this kind of data, Latitude and Longitudes, and to be honest, I have never matched based on these kind fields, it's kind of matching based on an approximation in distance...
I know the answer lies some place hidden within VFP. Any ideas on how to start 'asking' VFP to do this for me will be appreciated.
Thanks,
Tbl1 fields/records
name1, naddress, nlatitude, nlongitude, etc
name2, naddress, nlatitude, nlongitude, etc
Tbl2 fields/records
StoreName1, sAddress, slatitude, slongitude, etc
StoreName2, sAddress, slatitude, slongitude, etc
I want to find up to six records in tbl2 that are up to 5 miles in distance from records in Tbl1 based on the latitude and longitude, and then append them to that record in Tbl1 by distance order.
Fox example, if a record from Tbl1 has a "123 Anywhere St, Los Angeles, CA 90001" address, I want up to 6 records from Tbl2 that are within 5 miles of distance, and then appended to Tbl1 in distance order. My end result would be:
name1, naddress, nLatitude, nLongitude, StoreName1, sAddress, StoreName2, sAddress, StoreName3, sAddress, and so on, up to six storenames.
I've never worked with this kind of data, Latitude and Longitudes, and to be honest, I have never matched based on these kind fields, it's kind of matching based on an approximation in distance...
I know the answer lies some place hidden within VFP. Any ideas on how to start 'asking' VFP to do this for me will be appreciated.
Thanks,