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))
  • The result in Excel is: 8.846971361
  • The result in T-SQL is: 14.2453699180547

Why are the results different? Am I writing it wrong in T-SQL? Please help.

Cheers,

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top