November 25, 2008 at 12:57 am
Hi,
I am trying to calculate CAGR which when computed for two years, the formula is (Annual Turnover ^ 1/2)-1 and when computed for three years, the formula is (Annual Turnover ^1 / 3)-1 and when computed for four years, the formula is (Annual Turnover ^ 1/4)-1.
So, Can anybody suggest me how we can get the nth root of a number in SQL? I tried using power(Annual Turnover,(1/n)). It doesn't work.
Thanks in advance,
Valli
November 25, 2008 at 2:20 am
SELECT POWER(27.0E, 1.0E / 3.0E)
Beware of integer division.
N 56°04'39.16"
E 12°55'05.25"
November 25, 2008 at 3:11 am
Hi,
Thank you. It works fine.But if I would like to decide whether it is for 2 years or three years dynamically by finding the difference between the years, How do I do it?
November 25, 2008 at 3:33 am
See my article here about how to work with DATEDIFF function
N 56°04'39.16"
E 12°55'05.25"
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply