Thank you for this information. However, in my Access 2000 Help file, the
only reference to the LOG function is the following:
"LOG
Returns the logarithm of a number to the base you specify.
Syntax
LOG(number,base)
Number is the positive real number whose logarithm you want.
Base is the base of the logarithm; 10 if omitted."
There is a separate entry for the LN worksheet function. These do seem to
be more applicable to Excel worksheets than Access SQL, but I cannot find
any
reference to an SQL LOG function that gives the natural log. I double
checked my formula, and you are correct, it is returning the natural log.
Is
there an error in my Access Help files?
Thanks.
Ken Snell said:
VBA's Log function is the natural logarithm.
From ACCESS Help File:
Log Function
Returns a Double specifying the natural logarithm of a number.
Syntax
Log(number)
The required number argument is a Double or any valid numeric expression
greater than zero.
Remarks
The natural logarithm is the logarithm to the base e. The constant e
is
approximately 2.718282.
You can calculate base-n logarithms for any number x by dividing the
natural logarithm of x by the natural logarithm of n as follows:
Logn(x) = Log(x) / Log(n)
The following example illustrates a custom Function that calculates
base-10 logarithms:
Static Function Log10(X)
Log10 = Log(X) / Log(10#)
End Function
--
Ken Snell
<MS ACCESS MVP>
kraymond said:
I want to calculate the following expression in a query, where LN is the
natural log function.
10-((LN(Sum([sciPercentTolerantTaxa])+1))/4.1)*10)
I get an error message saying that LN is undefined. Does Access not
compute
LN(x)? The LOG(x, base) function works in my expression, but I don't
want
to
use Log10 (the default) or an approximate base "e" for natural log.
Is VBA my only option? I'm trying to avoid it if I can.
Thanks