Hi,I am trying to run a simple function I have created with :Select dbo.StartYearbut get the following errorMsg 4104, Level 16, State 1, Line 1The multi-part identifier "dbo.StartYear" could not be bound.The Code for the function is
set ANSI_NULLS ONset QUOTED_IDENTIFIER ONGO-- =============================================-- Author: Gavin Blackford-- Create date: 15-March-2007-- Description: Returns Start AutoCost Year-- =============================================ALTER FUNCTION [dbo].[StartYear] ()RETURNS varchar(4)ASBEGIN -- Return the current autocost startyear RETURN convert(varchar,(select prefvalue from prefs where prefname = 'AutoCostYear'))END
Can anyone help.Thanks,Gavin,