Very quick response Many thanks for this.
Jan
Main Topics
Browse All TopicsI have got code fomr the Net to replicate the NORMSDIST function VB that i converted to TSQL, however it close to EXCEL until the higher negative numbers. all positive number come back with the same a excel and on the negative side it close but starts to deviate aroun -1.5 and completely different to the EXCEL function by -2. Any help would be very very very helpfuly.
CREATE FUNCTION UCI_FN_STANDARD_NORM_CUMUL
RETURNS NUMERIC(19,16)
AS
BEGIN
DECLARE @Z NUMERIC (19,16),
@P NUMERIC (19,16),
@T NUMERIC (19,16),
@B1 NUMERIC (19,16),
@B2 NUMERIC (19,16),
@B3 NUMERIC (19,16),
@B4 NUMERIC (19,16),
@B5 NUMERIC (19,16)
SET @Z = 1 / SQRT(2 * 3.14159265359) * EXP((POWER(-@X,2) / 2)*-1)
SET @P = 0.2316419
SET @B1 = 0.31938153
SET @B2 = -0.356563782
SET @B3 = 1.781477937
SET @B4 = -1.821255978
SET @B5 = 1.330274429
SET @T = 1 / (1 + @P * @X)
RETURN 1 - @Z * (@B1 * @T + @B2 * POWER(@T, 2) + @B3 * POWER(@T,3) + @B4 * POWER(@T, 4) + @B5 * POWER(@T, 5) )
END
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: prabhakaranbkPosted on 2009-11-05 at 09:46:16ID: 25751956
Please check out the code below,
The code is from SQLServerCentral.com
Select allOpen in new window