Solved

SQL SERVER IRR function

Posted on 2010-11-10
2
936 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Introduction: Sometimes when I receive a call from my users to solve their problems it is very difficult for me to found their computer IP address. Even finding their computer Host to provide remote support can be a problem.  So I resorted to Goo…
Experts-Exchange users below are the steps you can follow to upgrade your Lync server to latest CU's or cumulative updates. Note: Perform it during non-production hours.   Step 1: Backup your lync and SQL server database. Follow below article: h…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now