Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-10-16 : 10:33:38
|
Hi,This is an excel formula:=IF(1276<300, "NA",((34.45/100+1)^(300/1276)-1)*100)How can I translate it to sql with power function please?My main issue is that I can not get the power in sql to basically give the same answer as((34.45/100+1)^(300/1276)-1)*100The answer should be 7.21Thanks |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-10-16 : 10:44:45
|
Use power functionselect power(34.45/100+1,(300/1276)-1)*100MadhivananFailing to plan is Planning to fail |
 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-10-16 : 10:47:57
|
quote: Originally posted by madhivanan Use power functionselect power(34.45/100+1,(300/1276)-1)*100MadhivananFailing to plan is Planning to fail
This gives 7.21=((34.45/100+1)^(300/1276)-1)*100Your sql does not give this answer. |
 |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-10-16 : 11:08:37
|
Rearrange the brackets a little bit:(POWER((34.45/100+1),(300.0/1276))-1)*100 |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-10-16 : 11:11:30
|
to get 7.21:select convert(decimal(12,2),(power((34.45/100.00+1.00),(300.00/1276.00))-1.00)*100.00) Too old to Rock'n'Roll too young to die. |
 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-10-16 : 11:28:56
|
Thank you |
 |
|
|
|
|