I have a MySql query working great but I can not convert it to Access 2007!
I'm getting an error that SQL in Access 2007 does not understand the acos, atn, and sin variables in a query that I have. This query works great in MySql but I'm having trouble writing it to work in Access 2007. The query is looking for all of the hospitals within a radius of 100 miles from a fixed lat/lon point in Berlin, Maryland (38.2287570, -75.21122790. The 3959 sets the Miles parameter and the radians equation is based on the ‘haversine’ formula to calculate the radius area.
Can anyone help me translate this MySql query into an Access 2007 query:
SELECT `ID`, `Hospital`, `City`, `State`, `Telephone`, ( 3959 * acos( cos( radians(38.2287570) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-75.2112790) ) + sin( radians(38.2287570) ) * sin( radians( lat ) ) ) ) AS distance FROM directors HAVING distance < 100 ORDER BY distance