N
Nancy
I have a simple query which uses a function to return a numeric value
representing distance between to locations.
The user is prompted to enter the Starting Latitude and Longitude
coordinates and the function compares those to a search table a returns the
distance in miles. Problem is, it returns a value for all records in my
search table.
I want to limit the number of records returned by a specific number of miles
(ie: all records less than 75 miles from the Starting Lat/Lon). But when I
enter a value in the Access criteria such as <75, I recieve the error "This
expression...is too complex to be evaluated.
Here is my SQL statement:
SELECT COMPANY2.D_CODE, COMPANY2.[COMPANY NAME], COMPANY2.CITY,
COMPANY2.[STATE/PROV], COMPANY2.[ZIP/P_CODE], COMPANY2.FirstOfCOUNTY_DESC AS
COUNTY, tblCompanyLatLon_ALL.LATITUDE, tblCompanyLatLon_ALL.LONGITUDE,
Val(DistCalc([Enter Starting Latitude],[Enter Starting
Longitude]*-1,[LATITUDE],[LONGITUDE],"M")) AS [Distance from Center
FROM COMPANY2 LEFT JOIN tblCompanyLatLon_ALL ON COMPANY2.D_CODE =
tblCompanyLatLon_ALL.D_CODE
WHERE (((tblCompanyLatLon_ALL.LATITUDE) Is Not Null))
ORDER BY Val(DistCalc([Enter Starting Latitude],[Enter Starting
Longitude]*-1,[LATITUDE],[LONGITUDE],"M"));
Any help would be appreciated.
Thanks, Nancy
representing distance between to locations.
The user is prompted to enter the Starting Latitude and Longitude
coordinates and the function compares those to a search table a returns the
distance in miles. Problem is, it returns a value for all records in my
search table.
I want to limit the number of records returned by a specific number of miles
(ie: all records less than 75 miles from the Starting Lat/Lon). But when I
enter a value in the Access criteria such as <75, I recieve the error "This
expression...is too complex to be evaluated.
Here is my SQL statement:
SELECT COMPANY2.D_CODE, COMPANY2.[COMPANY NAME], COMPANY2.CITY,
COMPANY2.[STATE/PROV], COMPANY2.[ZIP/P_CODE], COMPANY2.FirstOfCOUNTY_DESC AS
COUNTY, tblCompanyLatLon_ALL.LATITUDE, tblCompanyLatLon_ALL.LONGITUDE,
Val(DistCalc([Enter Starting Latitude],[Enter Starting
Longitude]*-1,[LATITUDE],[LONGITUDE],"M")) AS [Distance from Center
FROM COMPANY2 LEFT JOIN tblCompanyLatLon_ALL ON COMPANY2.D_CODE =
tblCompanyLatLon_ALL.D_CODE
WHERE (((tblCompanyLatLon_ALL.LATITUDE) Is Not Null))
ORDER BY Val(DistCalc([Enter Starting Latitude],[Enter Starting
Longitude]*-1,[LATITUDE],[LONGITUDE],"M"));
Any help would be appreciated.
Thanks, Nancy