February 18, 2010 at 4:18 am
Im am trying to rewrite a vba Function into T-SQL
I have a math calculation in vba which correctly calculates
(1 - 1.5 * (0.11852 - 0.05478 * Log((3.00/ 10000))) ^ 2)
to 0.524748374189154
I cant get it to work in sql, Ive currently at
power(1 - 1.5 * (0.11852 - 0.05478 * Log((3.00/ 10000))) ,2)
which gives a different answer.
Am I doing something wrong?
February 18, 2010 at 4:31 am
sanjsharma (2/18/2010)
Im am trying to rewrite a vba Function into T-SQLI have a math calculation in vba which correctly calculates
(1 - 1.5 * (0.11852 - 0.05478 * Log((3.00/ 10000))) ^ 2)
to 0.524748374189154
I cant get it to work in sql, Ive currently at
power(1 - 1.5 * (0.11852 - 0.05478 * Log((3.00/ 10000))) ,2)
which gives a different answer.
Am I doing something wrong?
select power(1 - (1.5 * ((0.11852 - 0.05478) * Log((3.00/ 10000)))) ,2)
returns
3.15262155946613
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
February 18, 2010 at 4:38 am
Thanks for your reponse.
Ive worked it out now, I had the power in the wrong place
it shouls have been
select (1 - 1.5 * power((0.11852 - 0.05478 * Log((3.00 / 10000))) ,2))
Thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy