LOG
is giving you the natural log. You have a problem with your parentheses
1 - 3.3387306 * LOG(0.234367344) + 1.426559 * POWER(LOG(0.234367344)), 2)
should give you the same answer as Excel.
Question
Can someone help me with POWER function in T-SQL..?
I am trying to calculate this in my stored procedure, this formula is coming from an Excel file
=(1 - 3.3387306 * LN(0.234367344) + 1.426559 * (LN(0.234367344)) ^ 2)
I write it down in my stored procedure like this:
=(POWER(1 - 3.3387306 * LOG(0.234367344) + 1.426559 * (LOG(0.234367344)), 2))
8.846971361
14.2453699180547
Why are the results different? Am I writing it wrong in T-SQL? Please help.
Cheers,
La solution
LOG
is giving you the natural log. You have a problem with your parentheses
1 - 3.3387306 * LOG(0.234367344) + 1.426559 * POWER(LOG(0.234367344)), 2)
should give you the same answer as Excel.