Cannot find either column "dbo" or the user-defined function
-
Friday, January 18, 2013 8:49 AM
Hi,
I am writing a code in custom code to access the sql data.
Function westsubsum() As decimal
Dim conn As New System.Data.SqlClient.SqlConnection ("Data Source=asharaf;Initial Catalog=test;Integrated Security=true")
conn.Open()
Dim Cmd As New System.Data.SqlClient.SqlCommand
Cmd.Connection = conn
Cmd.CommandText = "select dbo.calculatesumwithdate(1000000,2000000,'12/31/2008')"
Dim totval As Decimal = Cmd.ExecuteScalar()
conn.Close()
return totval
end function
i calles in expression as =code.westsubsum
i m getting #error in my expressionwhen i run this in reporting server
i am getting this error
Cannot find either column "dbo" or the user-defined function
All Replies
-
Friday, January 18, 2013 9:47 AM
Hi Asharaf,
Please check that the functon exists in the database or not.
and take a look on the same thread:
For User-defined function:
http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
Regards Avanish T
- Edited by Avanish Tomar Friday, January 18, 2013 9:47 AM
-
Friday, January 18, 2013 10:12 AM
Hi Avanish,
The function exist.
USE
[GMCSS]
GO
SET
ANSI_NULLS ON
GO
SET
QUOTED_IDENTIFIER ON
GO
ALTERFUNCTION [dbo].[calculatesumwithdate](@range1 int,@range2 int,@enddate date)
RETURNS
decimal(18,2)
AS
BEGIN
DECLARE @subtotal decimal(18,2)
select @subtotal=sum(Amount) from dbo.[COMMERCIAL SECTOR$G_L Entry] where "Posting Date" <= @enddate and "G_L Account No_" between @range1 and @range2
RETURN @subtotal
END
-
Friday, January 18, 2013 10:39 AMAny help?
-
Friday, January 18, 2013 1:38 PM
any help????
i did this also
but it stillshow the #error when i am putting the try and catch the field shows zero.
i tried my maximum....
I am going to giveup :(
- Edited by Asharaf P Friday, January 18, 2013 1:40 PM

