本文介绍了如何在MS-Access中触发Tris函数Arc Cos(Excel中的ACOS())?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel公式,需要将其放入MS-Access查询中.不幸的是,Arc Cosine函数似乎不属于Access的全部功能.因此,在Excel中,公式的一部分是ACOS(很多东西).所以我的问题是如何在MS-Access中实现ACOS()Excel函数?

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?

注意:万一有人想知道它,或者由于某种奇怪的原因实际上很重要,这是Excel中显示的完整等式:

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:

第AX和AZ列代表纬度,而AY和BA列代表经度,此等式获取两点之间的距离(以英里为单位).在有人提出它之前,我知道Access不具有Radians功能.我已经用等效的操作替换了它.我当然已经将列引用从Excel更改为适当的Access字段引用.

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.

推荐答案

我发现了两种方法.第一个,也是我使用的一个,是对ACOS()函数使用等效的trig标识:

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:

Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)

这对我来说是一个相当长的方程式,但是它可以正常工作,并且运行时间不会很长.我已阅读(但未经测试)的另一种解决方案是创建

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

Excel.WorksheetFunction.ACOS(TheNumberGoesHere)

Excel.WorksheetFunction.ACOS(TheNumberGoesHere)

这篇关于如何在MS-Access中触发Tris函数Arc Cos(Excel中的ACOS())?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 16:16