SQL Serer POWER函数 [英] SQL Serer POWER function
问题描述
谁能帮忙吗?我目前正在尝试将此Excel公式转换为SQL Server 2005,但似乎无法掌握POWER()函数–谁能告诉我我要去哪里了?
Excel公式是正确的,不需要调整.
Excel公式:
=((1+(5.47 + 1.65/100)/4)^(1/3)-1)
结果:
0.333568535
SQL Server:
SELECT POWER((1+(5.47 + 1.65/100)/4),3)-1
结果:
12.33945417
谢谢.
Hi,
Can anyone please help with this? I am currently trying to transpose this Excel formula to SQL Server 2005 but I can not seem to get to grips with the POWER() function – could anyone tell me where I am going wrong?
The Excel formula is sound and does not need adjusting.
Excel formula:
=((1+(5.47+1.65/100)/4)^(1/3)-1)
Result:
0.333568535
SQL Server:
SELECT POWER((1+(5.47+1.65/100)/4),3)-1
Result:
12.33945417
Thanks.
推荐答案
SELECT POWER((1+(5.47 + 1.65/100)/4),3)-1
SELECT POWER((1+(5.47+1.65/100)/4),3)-1
我相信您尝试的是Power 3而不是1/3
试试:
i believe you are trying power 3 instead of 1/3
try:
SELECT POWER((1+(5.47+1.65/100)/4),1/3)-1
Aprevoius的响应是正确的,因为我需要将1/3的幂增加1/3的因数:
SELECT POWER((1+(5.47 + 1.65/100)/4),0.33333333)-1
代替:
SELECT POWER(((1+(5.47 + 1.65/100)/4),1/3)-1
感谢您的帮助.
Hi,
Aprevoius response was correct in that i needed to add the factor of 1/3 to the power of one third:
SELECT POWER((1+(5.47+1.65/100)/4), 0.33333333)-1
instead of:
SELECT POWER((1+(5.47+1.65/100)/4), 1/3)-1
thanks for your help.
这篇关于SQL Serer POWER函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!