I have an excel formula that I need to put into an MS-Access query. Unfortunately, an Arc Cosine function does not seem to be part of Access's repertoire. So in Excel, part of the formula is ACOS(Lots of stuff). So my question is how can I achieve an ACOS() Excelfunction in MS-Access?
Note: In case anyone is wondering or in case it actually matters for some odd reason, here is the full equation as it appears in Excel:
=(ACOS(SIN(RADIANS(AX2))*SIN(RADIANS(AZ2))+COS(RADIANS(AX2))*COS(RADIANS(AZ2))*COS(RADIANS(AY2)-RADIANS(BA2)))*6367)*0.621
Columns AX and AZ hold latitudes and AY and BA hold longitudes and this equation gets the distance in miles between the two points. And before anyone brings it up I am aware that Access doesn't have Radians function. I have already replaced it with an equivalent operation. I of course have changed the column references from Excel to the appropriate Access field references.
I have found two ways to do this. The first, and the one I used, is to use an equivalent trig identity for the ACOS() function:
This results in a rather long equation for me but it works and does not appear take very long to run. The other solution I have read about (but not tested) is to create a