0

This Error appear when I try to call the user-defined function

Cannot find either column "dbo" or the user-defined function or aggregate "dbo.fn_IntCalc", or the name is ambiguous

Here is the user-defined function:

CREATE FUNCTION dbo.fn_IntCalc (@IntersetRate NUMERIC(6, 3) = 10,
                                @Amount       NUMERIC(18, 5),
                                @FromDate     DATE,
                                @ToDate       DATE)
RETURNS NUMERIC(18, 5)
WITH EXECUTE AS CALLER
AS
  BEGIN
      DECLARE @IntCalculated NUMERIC(18, 5)

      SELECT @IntCalculated = @Amount * ( ( @IntersetRate / 100.0 ) 
             * ( DATEDIFF(d, @FromDate, @ToDate) / 365.0 ) )

      RETURN ( ISNULL(@IntCalculated, 0) )
  END

GO 

And The calling part is:

SELECT dbo.fn_IntCalc(DEFAULT,2000,'Mar 1 2008','Mar 10 2008')
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ibrahim
  • 77
  • 3
  • 10

2 Answers2

1

Please try

SELECT * FROM dbo.fn_IntCalc(DEFAULT,2000,'Mar 1 2008','Mar 10 2008')

Hope it helps

Andre Figueiredo
  • 12,930
  • 8
  • 48
  • 74
John Smith
  • 11
  • 4