IRR Function - Comparing Results Between Systems

Jan 13, 2012

I'm working on an income deferral problem and we are using IRR to end up calculating periodic income.

As an example, I have the following inputs:

Number of periods = 9
Initial Loan = 21.46
Instalment amount =15.30
Future value=0
Guess=0.1 (10%)

Using a compiled function from Visual Studio in SQL Server 2008 we get a result of 70.71656373

Using a Microsoft Access function we get NaN

Using Microsoft Excel we get NaN

Using a web calculator we get 70 (ish, the calculator rounds the numbers)

I know that the numbers are odd, some of our data is dirty so we do expect that. I was expecting the SQL process to kick out an error (therefore converting the result into 0), but it doesn't.

View 1 Replies


ADVERTISEMENT

Comparing Set Of Results

Nov 20, 2007

Is there a way to create a query which compares two result sets of results?
for example the result set of my first select statement is 7,1,8 and the second result set is 7,1,9..is there a query wherein i can compare the two results? i just wanted to reveal that there is a diffrence between the two..

thank you..

Funnyfrog

View 5 Replies View Related

Utilities For Comparing Stored Procedure Results?

Dec 11, 2007

I have large stored procedures in SQL Server 2005 that often get updated. Sometimes it is very difficult to recognize how one change could impact the overall results. I would like to have some sample input that I could test during changes and see it compare the data results before & after my changes. This would help me quickly identify if the results are fine to pass through.

So basically I would like an easy way to compare the results of 2 stored procedures. Any suggestions or utilites that would help me do this?

View 3 Replies View Related

Compare Utilities For Comparing Stored Procedure Results?

Dec 10, 2007

I have large stored procedures in SQL Server 2005 that often get updated. Sometimes it is very difficult to recognize how one change could impact the overall results. I would like to have some sample input that I could test during changes and see it compare the data results before & after my changes. This would help me quickly identify if the results are fine to pass through.

So basically I would like an easy way to compare the results of 2 stored procedures. Any suggestions or utilites that would help me do this?

View 6 Replies View Related

Wierd Query Results When Comparing Field Values

May 8, 2008

Hi Guys, I am experiencing weird results

SELECT DSNew, DTTM, RQDT
FROM dbo.Feb
INNER JOIN DMSEFL
ON ACTR = DSNew
where cast(DSNew as varchar(20)) = cast(ACTR As varchar(20))
If I run the above query I get zero recs back.

If I substitute a Value then I get the desired results (ie. where DSNew = '93235500') or if I enter (ACTR = '93235500') or if I put (where DSNew = '93235500' AND ACTR = '93235500')

Can anyone suggest a reason why this is happening. I know the records exist on both tables I ran the query in Acess and got the desired resutls.

Thank you,
Trudye

View 4 Replies View Related

Function Using Comparing Dates Not Working Right

Sep 12, 2006

Hi,

I'm trying to write a function to return all notes with date. Sample data for 1 record=187189 as follows:
iincidentid,iWorkNoteId,iSeqnum, dtEntryDate, workNoteAll
1871893440 1 2006-04-24 note1
1871893545 1 2006-06-22 note2
1871893547 1 2006-06-22 note3
1871893653 1 2006-08-10 note4
1871893653 2 2006-08-10 note5

funtion will return = 2006_08-10 note4 note5 for iincidentid=187189
-----------------------------------------------------
CREATE FUNCTION dbo.getIncidentNotesRev(@iIncidentID int)
RETURNS varchar(8000)
AS
BEGIN
declare @incidentId int
declare @worknoteid int
declare @worknotesaveid int
declare @seqnum int
declare @dtEntryDate smalldatetime
declare @worknoteall varchar(8000)
declare@allnotes varchar(8000)
declare @currentWEDate smalldatetime
declare @beginWEDate smalldatetime

select @allnotes=''
select @currentWEDate=currentweekEndDate from csCurrentweekEndDate --get the current week end date
select @beginWEDate = DATEADD(d, - 28, @currentWEDate)--get the last 4 weeks

declare CursorIncident CURSOR
LOCAL FOR SELECT iIncidentId, iWorkNoteID, iSeqNum, dtEntryDate,worknoteall FROM dbo.rpt_weekly_prospect_status_vw
where iIncidentId=@iIncidentID order by iWorkNoteId

OPEN CursorIncident
FETCH NEXT FROM CursorIncident INTO @incidentId,@worknoteid,@seqnum,@dtEntryDate,@work noteall

--store 1st record of cursor
select @worknotesaveid =@worknoteid
WHILE (@@FETCH_STATUS=0)
BEGIN
if @dtEntryDate >=@beginWEDate AND @dtEntryDate <= @currentWEDate
Begin
if @worknotesaveid <> @worknoteid
Begin
Select @allnotes = @allnotes + @dtEntryDate + @worknoteall
End
else
BEgin
select @allnotes = @allnotes + @worknoteall
End

select @worknotesaveid = @worknoteid --save next worknoteId
End
else
Begin
select @allnotes=''
End
FETCH NEXT FROM CursorIncident INTO @incidentId,@worknoteid,@seqnum,@dtEntryDate,@work noteall
END --WHILE (@@FETCH_STATUS=0)

CLOSE CursorIncident
DEALLOCATE CursorIncident

return @allnotes
END

----------
Function not working right. I appreciate any help.
Thanks in advance.

View 3 Replies View Related

Var Function Results

May 10, 2006

Could anyone tell me why the following code produces a result of 2.5 instead of 2 ?

CREATE TABLE MyValues (MyValue Float)
INSERT INTO MyValues (MyValue) SELECT 2
INSERT INTO MyValues (MyValue) SELECT 3
INSERT INTO MyValues (MyValue) SELECT 4
INSERT INTO MyValues (MyValue) SELECT 5
INSERT INTO MyValues (MyValue) SELECT 6
SELECT VAR(MyValue) FROM MyValues AS MyVariation

View 4 Replies View Related

Sum Function Yielding Bad Results

Feb 20, 2004

I've inherited the following code:

SELECT TOP 100 PERCENT dbo._Options_Demographics.GradeLevel, dbo._Options_Demographics.Gender, dbo._Options_Demographics.Ethnicity,
dbo._Options_Demographics.Age, SUM(dbo._Options_Demographics.Enrollment) AS Enrollment, dbo._Options_Demographics.OptionsYear,
dbo._Options_Demographics.OptionsMonth
FROM dbo._Options_Confirmed INNER JOIN
dbo._Options_Demographics ON dbo._Options_Demographics.DistrictCode = dbo._Options_Confirmed.DistrictCode
GROUP BY dbo._Options_Demographics.GradeLevel, dbo._Options_Demographics.Gender, dbo._Options_Demographics.Ethnicity,
dbo._Options_Demographics.Age, dbo._Options_Demographics.OptionsYear, dbo._Options_Demographics.OptionsMonth
ORDER BY dbo._Options_Demographics.OptionsYear, dbo._Options_Demographics.OptionsMonth, dbo._Options_Demographics.GradeLevel,
dbo._Options_Demographics.Gender, dbo._Options_Demographics.Ethnicity, dbo._Options_Demographics.Age

which returns this data (the enrollment value is 4 times the correct value)
grade gender eth ageenrollyearmonth
8FemaleBlack1618112003December
8FemaleBlack1716212003December
8FemaleBlack187932003December
8FemaleBlack18P2872003December



If I remove the sum function and manually add, my totals are correct ...
SELECT TOP 100 PERCENT _Options_Demographics.GradeLevel, _Options_Demographics.Gender, _Options_Demographics.Ethnicity,
_Options_Demographics.Age, _Options_Demographics.Enrollment, _Options_Demographics.OptionsYear,
_Options_Demographics.OptionsMonth
FROM _Options_Confirmed RIGHT OUTER JOIN
_Options_Demographics ON _Options_Demographics.DistrictCode = _Options_Confirmed.DistrictCode
GROUP BY _Options_Demographics.GradeLevel, _Options_Demographics.Gender, _Options_Demographics.Ethnicity, _Options_Demographics.Age,
_Options_Demographics.Enrollment, _Options_Demographics.OptionsYear, _Options_Demographics.OptionsMonth
ORDER BY _Options_Demographics.OptionsYear, _Options_Demographics.OptionsMonth, _Options_Demographics.GradeLevel,
_Options_Demographics.Gender, _Options_Demographics.Ethnicity, _Options_Demographics.Age

I've been looking at this for too long and I know that is something very trivial ...

William

View 2 Replies View Related

Different Results With CAST Function

Jul 25, 2013

When I test the CAST function on AdventureWorks2012, the CAST function will round down or up, i.e. 2024.994 to 2025 or 5.1865 to 5.

However, when I try the same the CAST function as:

SELECTCAST(2024.994 AS INT) the result I get is now 2024 (and not 2025).

Why is CAST rounding up when I use it on a table in the AdventureWorks2012 database, but when I use CAST on its own, it rounds down?

View 5 Replies View Related

Referring To Function Results In Connection Manager

Nov 9, 2007



Hello! My group uses scalar-valued functions to denote the FTP drives on our SQL Server 2005 database servers. This allows many (over 100) import processes to refer to that function to find the flat files they need, and if the FTP drive is changed, then only the function needs to be updated, not 100 SP's.

The function is defined this way. Currently, F: is our FTP drive:

CREATE FUNCTION [dbo].[fnFTPPath] ()
RETURNS varchar(200) AS
BEGIN

return 'f:'
END


Now the question: Can a Flat File Connection Manager be used in an SSIS ETL package that refers to the output of this function, plus the FTP folder name, so we can continue updating the FTP drive name in just one place? If so, how is this done?

Thank you!

View 1 Replies View Related

Datetime Function Glitch -- Same Settings, Different Results

Oct 23, 2006

hi guys,

i am encountering a pretty weird problem on our SQL database stored procs, particularly those concerning datetime functions. we have two setups, one is on london, and another one is here in singapore. both servers have the same regional settings, the same database tables, stored procs and functions, almost the same in every aspect. the only difference we know is that one is a direct database cut (sql 7.0), while the other used database migration in win2k.

here goes: all stored proc functions work just fine on the singapore setup. the london setup however, is not working at all! it does all the functions like change flags and status, but it doesn't update dates nor search for data by date. i have also checked on the collision names, and they are the same. where else could i start searching for discrepancies between the two?

hope to hear something from you guys, i'm getting desperate. thanks in advance!



View 5 Replies View Related

Transact SQL :: GetDate Function Not Returning Any Results?

May 27, 2015

I am having a problem with the GETDATE().

WHERE TableName.ColumnNamne = Getdate()

The above SQL function does not return any results whereas the below SQL code returns results. Am I doing anything wrong?

WHERE SalesOrder.New_ActualShipmentDate >= GETDATE()

View 35 Replies View Related

SQL Server 2014 :: CLR Function And NET Framework Return Different Results

Nov 1, 2014

I have rather simple CLR function:

[SqlFunction(IsDeterministic = true, DataAccess = DataAccessKind.None)]
public static SqlString GetUserName()
{
return (SqlString)WindowsIdentity.GetCurrent().Name;
}

When I get result from .NET console app, I get correct answer "JungleSektor". However, when SQL Server executes this code, it gives me "NT ServiceMSSQL $ SQL2014". How to get correct result?

View 1 Replies View Related

A Basic Question: Removing Duplicate Results From Max Function

Jun 10, 2006

Hi,Say I have a table Job with columns name, date, salary . I want to getthe name ,date and salary for the date when that person earned maximumsalary. I am using something likeSELECT X.name,X.date,X.salaryFROM job XWHERE X.salary IN(SELECT MAX(Y.salary) FROM job Y where Y.name= X.name);The problem is ; if a person earns maximum salary on two dates, both ofthe dates are printed. I just want to get any one of those two rows.I triedSELECT X.name,Min(X.date),X.salaryFROM job XWHERE X.salary IN(SELECT MAX(Y.salary) FROM job Y where Y.name= X.name);but it gives error.Can anybody please suggest a solution?Regards,Aamir

View 4 Replies View Related

Using Datediff Function To Return 1st Of Month. Different Results With T-SQL And SSIS

May 15, 2007

Hi



I regularly use the T-SQL date functions to return the 1st of a particualr month.



e.g.



SELECT DATEADD(m,DATEDIFF(m,0,getdate()),0)



returns 2007-05-01 00:00:00.000



i.e the first of the current month at midnight.

However, when I try to use a similar expression as a derived column in SSIS it returns a completely different date.



DATEADD("month",DATEDIFF("month",(DT_DATE)0,GETDATE()),(DT_DATE)0)



returns 30/05/2007 00:00:00





Any ideas why and how I can obtain the first of a particualr month using SSIS derived column?





View 3 Replies View Related

Analysis :: Statistical Function Results In Calculated Members

Jul 8, 2015

I'm working with the statistical functions Stdev and Median with calculated members.  The only way I can get the "correct" answer is if I have a dimension at the same granularity as the Fact table (Actually it's a degenerate dimension of the FACT table itself).  Otherwise it seems that the measure I'm using with Stdev returns results that are so wildly high, I think it must be acting on the SUM of the measure; because the measure itself is a Summed one. When I try to use the coordinates in the Stdev function, it seems like it is using the wrong set of data points :

stdev( ( [Date].[Date].[Date].members, [Parameter].[Parameter].[Parameter].members ), [Measures].[Value])  returns answers in the thousands when it should be more like 2.5

When used with a query, there would only be a single date member and a specific parameter member.  The total number of fact records is between 200 and 500 with values that range between 0 and 150.  This is the version that gives me answers that resemble the total sum of the [Measures].[Value].

If I add the dimension that is essentially a row number from the fact table, it gives the right answer (slowly, but that will be a different post ....

stdev( ( [Date].[Date].[Date].members, [Parameter].[Parameter].[Parameter].members, [FACTTable].[FACTTable].[KeyField].members ), [Measures].[Value])

View 4 Replies View Related

User Defined Function Gives Different Results On Subsequent Runs

Feb 25, 2008



Hi

I have a UDF
---------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UDF_AlphaNumeric]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[UDF_AlphaNumeric]
GO

CREATE function UDF_AlphaNumeric (@string nvarchar(max)) returns nvarchar(max)
AS
-- select dbo.UDF_AlphaNumeric('a[]#b`c,;"1$%^2"£!3')
begin
while @@rowcount > 0
select @string = replace(@string, substring(@string, patindex('%[^0-9a-zA-Z]%', @string), 1), '')
where patindex('%[^0-9a-zA-Z]%', @string) <> 0

if @string = ''
select @string = null

return @string
end

---------------------

After creating the function I open a new query window, put in the below two calls to the function, and run them


select dbo.ADE_AlphaNumeric('a432[]#b`c,;gfd23$%^789')
select dbo.ADE_AlphaNumeric('a432[]#b`c,;gfd23$%^789')

The results then look like this:

a432[]#b`c,;gfd23$%^789
a432bcgfd23789

The first time it runs, it's not having the desired effect. Any subsequent calls to the function perform as expected.


I am using SQL Server 2005 SP2. Is this a known issue? Or is there some setting I am missing?

Cheers

Neil

View 7 Replies View Related

How To Determine, Inside A Function, If A Linked-server-query Returned Results

Feb 13, 2004

Hi, have configured an ODBC linked server for an Adaptive Server Anywhere (ASA6.0) database.
I have to write a function (not a procedure) that receives a number (@Code) and returns 1 if it was found on a table in the linked server, or 0 if not. Looks very simple...
One problem, is that the queries on a linked-server must be made through the OPENQUERY statement, which doesen't support dynamic parameters. I've solved this making the whole query a string, and executing it, something like this:

SET @SQL='SELECT * FROM OPENQUERY(CAT_ASA, ''SELECT code FROM countries WHERE code=' + @Code + ''')'
EXEC sp_executesql @SQL

(CAT_ASA is the linked-server's name)

Then, i would use @@ROWCOUNT to determine if the code exists or not. But before this, a problem appears: sp_executesql is not allowed within a function (only extended procedures are allowed).
Does somebody know how to make what i want?? I prefer to avoid using temporary tables.
Thanks!

View 3 Replies View Related

DTS And Operating Systems

Sep 18, 2002

I have created a VB 6.0 application that reads data from old db files into the SQL Server 2000 database using DTS stored structure files.

The application works fine with Windows NT but I keep getting an error in Windows 2000 environment.
"-2147220441(80040427) Execution Canceled By User"

Any ideas why?

View 1 Replies View Related

Systems Locks On SQL 6.5

Sep 15, 1999

I have a problem where Backup Exec crashed during a backup of a SQL database and now SQL show 3 extent lock that are now redundant. These cannot be removed from Enterprise manager Is it therefore possible to remove them directly from the master database ??

Thanks

View 1 Replies View Related

Sync Between Two Systems

Mar 18, 2007

I need to syncronize two separate databases. One is SQL Server the other is MySql. I don't have a lot of experience with MSSQL and need a little advice on how best (in terms of speed especially) to gather records that have been added since the last sync and any that have been modified. The table in question has datetime fields for both, the time each record was created (CreatedTime) and the time that the record was last modified (ModifiedTime). Sync will happen daily.

I have worked out a few ways I might do this with DATEADD or DATEDIFF, but my question is, what is the most effecient way? Currently I'm just looking for a way to get inserted and updated records from SQL Server to MySQL. I may have to do a two way sync of some sort later.

View 2 Replies View Related

I Don't Want To See Systems Objects

Jun 14, 2006

I don't wich choice should I made to avoid have to see the systems objects, for intance, when I open the tables of any Data Base I have like 50 that I haven´t create, so if any one can help me, I will be gratefull, it might sound like BOBO, but I jist don't know. Thanks


informatics

View 2 Replies View Related

Help Desk Systems..

Jul 20, 2005

I was wondering if anyone could suggest a web-based help desk systemthat uses MS SQL server that also has a knowledge base and also allowssupport employees to log how much time they have spent on eachparticular ticket. I'm after an 'affordable' system that would be usedby about 35 people.Otherwise, if you can think of a better place to ask around, let meknow!Regards,Belinda

View 1 Replies View Related

Document Management Systems

Jun 5, 2006

I have a client that would like to archive all of the documents .word, .xls, .pdf, .jpg, email coorespondance, etc. into some sort of database so in the near future when the project starts up again all of the information is in a clear consise format. I was hoping that this forum could provide some guidance in selecting a software package and a discussion on how to proceed.

I have 6 gigs of documents in a folder on our server.
I was planning on delivering the organized data on a external hard drive after putting the data into some sort of database.
I would like to include metadata about each particular document.
like
who created the document,
Key words about the document's purpose,
time frame the document is revelant for,
and so on.

I would like to use a database structure and possibly hot link the document to the DB.
I would like to use xml (if possible) for the metadata.

any help is greatly appreciated on this
I can be reached at

khively at maximusa dot com

for any additional questions

View 3 Replies View Related

Systems Analyst - Job Description

Apr 7, 2004

Does anyone have a description of what is a System Analyst responsibility should involve. I was recently assigned the title and is no longer sure what my responsibility should entail. I asked mgmt for a description. Still waiting.

Thanks.

View 8 Replies View Related

Single Or Multiple DB For Different Systems?

Jun 6, 2008

Hi everyone,

Im having a hard time deciding what approach should I take. The scenario is this: I have developed various systems (inventory, HR, accounting, etc.). All this systems are (and should be) tightly integrated with one another. At present, for all these systems, i've used a single DB prefixing the tables with the systems name (eg. Inventory.Items).

My question is: did I did the right (and practical) thing? Or should I create a DB for each system to organize them? The problem with multiple DBs is some system uses the other system's table(s). Example, if i created a separate DB for accounting, and a separated DB for inventory, and another for HR, how am I going to relate inventory and HR's accounts to the accounting DB's table? I want a single instance for each table; I don't want to create another account table for inventory or HR so I can enforce integrity. And if different DBs, is there a performance impact on this?

Or is there another way? My concern is performance and manageability. Please help. Thanks!

View 2 Replies View Related

64-bit SQL Server &#043; Operating Systems

Jun 12, 2008

I currently run SQL Server 2005 64-bit Developer Edition (Service Pack 2 - it will be SP 3 as soon as I can get hold of it). I am running this on a stand-alone box with Windows Server 2003 as the OS.

Soon, I will be buying another computer for a colleague who will be running SQL Server as specified above. However, I am not happy with Windows Server and am wondering about changing to either XP 64-bit or Vista 64-bit. The machine will not be networked.

I would welcome advice on this since, in some ways, I would be happy enough to use XP or Vista, and think that 64-bit development is more likely on Vista than on other Windows OS's. However, I am not convinced that SQL Server 2005 works with Vista and, like everyone else, have heard plenty of complaints about Vista.

All advice gratefully received.

Thanks.

Chris

View 5 Replies View Related

I MBA Systems (2005 Passout) And Doing OCA & OCP.

Mar 16, 2007

Hi evrybody,

I MBA Systems (2005 passout) and doing OCA & OCP.
but currently doing job as HR (1.5 yrs exp).

I want to know How tough it will be for me to get job in Software?

Is it so easy guys?

View 2 Replies View Related

2005 - Direct Modifications To Systems Catalogs

Jul 20, 2007

In 2000 there was a server level setting you could change in EM, to allow direct modifications to systems catalogs.

in 2005 I would like to update some sids in sysusers tables, do I also need to find and set this option first

View 6 Replies View Related

Backup Systems Support/Database Admin

Sep 14, 2007

Hey guys want a suggestion from you I am a Masters Student here in USA This forum helped me a lot when I was doing internship.My university is offering tution wavier for these to jobs "1)backup systems support
2)Database admin" .I know MySql also took course for basic database .
The question is if any of you please tell me what all I have to do in these job if ...if ... :) I get this job .Thanks based on your answer only I will apply for this job its 20 hrs a week commitment with college
assignment .

Thanks
Sam!

View 3 Replies View Related

SQL Server 2005 And File Systems, Any Recommendations

Aug 4, 2006

We're planning to migrate our db to new and more disk drives, fasterRAID levels and more dedicated disk usage(e.g. placing the translog ondedicated disks). The db server runs on Win2003.Right now we're thinking about what file system to use on the newdrives. We opt for performance, but expect reliability as well.(Goeswithout saying, IMHO ;-))


Quote:

View 18 Replies View Related

SQL Express, Operating Systems, Simultaneous Connections

Sep 28, 2007

I was going over this article , and was intrigued by this statement "If SQL Server 2005 Express is running on Windows XP Home, it is limited to five simultaneous connections. If it is running on Windows 2000 or Windows XP Professional, it is limited to 10 simultaneous connections. However, these are limitations of the operating system and not of SQL Server 2005 Express."

What are simultaneous connections? Is this related to Max worker threads defined as 255 on other editions? How does underlying OS impose how many connections can be done to SQL server. And finally how many simultaneous connections can be done in Windows Server 2003?

View 11 Replies View Related

Update Systems Tables In SQL Server 2005

May 20, 2008

I want to change the (dateformat) columns in (syslanguages) tables from dmy to mdy in SQL Server 2005,
but the update query did not success, and error message (Ad hoc updates to system catalogs are not allowed) .

Although I used

sp_configure 'allow updates',1

RECONFIGURE WITH OVERRIDE

before executing the update statement.

Can any body help me.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved