December 20, 2015 at 4:26 pm
I have tried a number of the different formulas to calculate XIRR in SQL 2005 and 2014 and while the example always seem to work, when I run them with our numbers the results are not correct. Even the XLeratorDB results do not appear correct. When I run the numbers through a .net version I get the correct results.
Using the sample at this link http://www.sqlservercentral.com/Forums/Topic919838-338-1.aspx
If I enter the numbers
-250000 8/31/2015
-250000 9/30/2015
498763.53 10/31/2015
I get the result -0.0000000008
where in the .net version is -0.00327844144912648
Has anyone else experienced this and if so is there a correct to the formula?
December 20, 2015 at 5:29 pm
Luckbox72 (12/20/2015)
When I run the numbers through a .net version I get the correct results.
If that's true, why not turn the .Net version into an SQLCLR function or stored procedure?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 21, 2015 at 1:03 pm
For anyone else looking for the correct formula I found another post were someone was having the exact issue I was.
Follow this link for the corrected script
http://stackoverflow.com/questions/20972209/xirr-calc-in-sql
This works in SQL 2014 and with some minor changes is easy to get to work in SQL 2005
December 21, 2015 at 2:03 pm
Luckbox72 (12/21/2015)
For anyone else looking for the correct formula I found another post were someone was having the exact issue I was.Follow this link for the corrected script
http://stackoverflow.com/questions/20972209/xirr-calc-in-sql
This works in SQL 2014 and with some minor changes is easy to get to work in SQL 2005
Just making it easier for others to follow:
http://stackoverflow.com/questions/20972209/xirr-calc-in-sql
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply