Microsoft
Software
Hardware
Network
Question : TSQL How to determine logarithm to base X
Hi
I need to determine the logarithm of a value to Log(BaseX) of a number using only TSQL syntax. SQL Server only seems to deal with Base 10.
e.g. Log(Base 2) of 8 = 3
I want to determine the answer 3 when I already know the number 8 and the base (2 in the example).
Is there a hidden function in TSQL that might help?
I know that I could write a CLR function to do this easily but this must work in SQL Server 7 and 2000 as well.
Many thanks
Answer : TSQL How to determine logarithm to base X
use SELECT LOG10 (X) /LOG10(Y) X is the value to be converted and Y is the new base value. use as SELECT LOG10 (8) /LOG10(2)
Random Solutions
What to install to us ARABIC characters for Adobe Photo Elements
Download File and Make it the Active Window
Question on Windows File Share Witness for a CCR setup
How do I get all the latest stuff for Fedora using yum?
Only select part of a column with SQL
If EXISTS with a Union statement - SQL Server 2005
SQL Server view error: View Definition includes no output columns or includes not items in the from Clause
Relaying denied. Proper authentication required
why does my swf flicker like this?
How to install "Developer tools" after installation completed