Solved

SQL SERVER IRR function

Posted on 2010-11-10
2
938 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:venanciop
2 Comments
 

Author Comment

by:venanciop
ID: 34107854
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
 
LVL 46

Accepted Solution

by:
tbsgadi earned 500 total points
ID: 34111080
Have a look at http:Q_23952396.html 

Gary
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have put this article together as i needed to get all the information that might be available already into one general document that could be referenced once without searching the Internet for the different pieces. I have had a few issues where…
This is a fairly complicated script that will install the required prerequisites to install SCCM 2012 R2 on a server.  It was designed under the functional model in order to compartmentalize each step required, reducing the overall complexity.  The …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question