Queries in access

  • Thread starter Thread starter Dan Rolfe
  • Start date Start date
D

Dan Rolfe

I'm trying to query a table in an Access database. I
eventually would like to find all premises within a 3 KM
radius of a given farm. Can you suggest a way to do this?
The SQL is as follows (ignore lack of punctuation as cut
and pasted).
PARAMETERS [Enter Latitude] IEEEDouble;
SELECT [NorCal Commercial].Prem_Id, [NorCal
Commercial].Own_Comp_Name, [NorCal
Commercial].Prem_Comp_Name, [NorCal
Commercial].Anim_Addr1, [NorCal Commercial].Anim_City,
[NorCal Commercial].Prem_Zip, [NorCal
Commercial].Anim_Lat, [NorCal Commercial].Anim_Long
FROM [NorCal Commercial]
WHERE ((([NorCal Commercial].Anim_Lat) Between "Enter
Latitude" And ("Enter Latitude"+0.02701)))
ORDER BY [NorCal Commercial].Anim_Lat;
I get a "too complicated" or "incorrectly typed" error.
What I planned to do is sequence the queries N, S, E and
W until I would have a list of farms within 3 KM of the
latitude and longitude entered. Lats and longs are in
decimal degrees.
Does anyone have a solution for my problem?
Thanks, Dan
 
Your WHERE clause has parameters, but they're in quotes. "Enter Latitude"
should probably be [Enter Latitude].


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top