Hello Friends
I have created an Access Frontend SQL Server backend application and one of my report is not working, whose record source is a SQL Server user defined function.When I try to open the report i get the following error
When I remove the fields related to Table1 from the report then I get the same error about Table2 amd Table3. Here is the sql script generated for the user defined function.
How I can tackle this problem?
I have created an Access Frontend SQL Server backend application and one of my report is not working, whose record source is a SQL Server user defined function.When I try to open the report i get the following error
Code:
The column prefix 'Table1' does not match with a table name or alias name used in the query.
Code:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Query1]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[Query1]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE FUNCTION dbo.Query1()
RETURNS TABLE
AS
RETURN ( SELECT TOP 100 PERCENT dbo.Table1.ID,dbo.Table2.Projekt AS [Table2.Projekt],
dbo.Table2.AOX AS [Table2.AOX], dbo.Table2.Blei AS [Table2.Blei], dbo.Table2.BTEX AS [Table2.BTEX],
dbo.Table2.[ph-Zulaufoben] AS Expr10,dbo.Table3.ID,dbo.Table3.Projekt AS [Table3.Projekt]
dbo.Table2.ortho AS Expr11, dbo.Table2.[absetzbare Stoffe] AS Expr12
FROM dbo.Table1 INNER JOIN
dbo.Table2 ON dbo.Table1.ID = dbo.Table2.ID INNER JOIN
dbo.Table3 ON dbo.Table1.ID = dbo.Table3.ID
ORDER BY dbo.Table1.ID, dbo.Table1.Dat DESC )
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO