SQL SERVER IRR function

I saw one in website, but it does not accept numbers with decimal cases, so is not 100% accurated.
I'd like to know if anyone has a IRR funtion.
venanciopAsked:
Who is Participating?
 
tbsgadiConnect With a Mentor Commented:
Have a look at http:Q_23952396.html 

Gary
0
 
venanciopAuthor Commented:
Actually the issue is not related to the function. But to a conversion.

declare @aux varchar(8000), @inicio datetime

set @inicio= getdate()-1

SET @AUX = (select convert( varchar(100),(cast(round(fc,2) as decimal(38,2))))+',' FROM t1 where dt_posicao = @inicio)

ERROR:
Conversion failed when converting the varchar value '-859396252.29,' to data type int.

It's crazy, because if I run the query as itself:
select convert( varchar(100),(cast(round(fc,2) as decimal(38,2))))+',' FROM t1 where dt_posicao = @inicio

It works:
-5454141.56,
16195539.63,
-775863.01,
25267295.91,
16633219.77,
1464111.18,
-12863222.99,
2963694.59,
-50465124.40,
-3044618.40,
10905439.85,
16471310.55,
5958809.99,
16423319723.80,
-859396252.29,
0
All Courses

From novice to tech pro — start learning today.