Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Log base 10 calculation in Access

Status
Not open for further replies.

dt2demar

Technical User
Nov 20, 2000
32
CA

I am puzzled by this seemingly simple task to calculate the log base 10 of a field of values. Any help would be greatly appreciated.

The natural log (ln) is easy to calculate: If 'field1' contains a list of numbers, then 'field2: log([field1])'.

How can I so the same for a log base-10?
'field2: log10([field1])' does not work. Unlike excel, Access is very limited in it's functions. I think I will have to program this in VBA to get it to work. If so, how would I do that?



 
If memory serves me, log10 (x) = ln(10) * ln(x). I find the childrens homework sites really useful for this type of thing which fell out of my brain many years ago! Peter Meachem
peter@accuflight.com
 

Thanks for your response, but your relationship is incorrect. Example:

log(0.001) = -3

ln(10)=2.3
ln(0.001)=-6.9
ln(10)*ln(0.001)=-15.88

log(0.001) does not equal ln(10)*ln(0.001)

Perhaps I could manipulate the 'exponent' function in some way to calculate a log, but I doubt it.

 

The function is LogN(X) = Log(X) / Log(N) Or Log10(X) = Log(X) / Log(10)

You can find more derived functions in Access Help under the title "Derived Math Functions."

Terry

X-) "I don't have a solution, but I admire your problem."
 
Well I wasn't that far out was I tbroadbent. You recall we were talking about why my customer had this strange sql server login problem? Eventually I went up to see them, together with the hardware suppliers. It turned out they had installed sql not in the nt domain. All better now. Peter Meachem
peter@accuflight.com
 

Thank-you too Petermeachem. You were very close. I have forgotten a lot more about logarithms than I realized!!

 
Actually try thre help system.

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


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top