Guys,A simple UDF, that I need to return a date based on some info in my DB, I wanted this as a UDF, which I have written and tested in SQL Server, works fine.
What I can't do is get the DDT to deploy it. I know my issue lies in the first 2-3 lines, but I really don't know what it might want.
Can anyone send me a translation of how it should be put into the DDT?
thanks in advance
G.
UDF is as follows
CREATE
FUNCTION [dbo].[FirstDayHolidayYear]() RETURNS
smalldatetimeAS
BEGIN
-- Declare the return variable hereDECLARE
@Year CHAR(4)DECLARE
@Month VARCHAR(2)DECLARE
@Day VARCHAR(2)SELECT
@year = YEAR(GETDATE())SELECT
@day = '01'IF
(SELECT annualleaveyearstart FROM dbo.ApplicationSettings)<10SELECT @Month = '0'+CAST(annualleaveyearstart AS CHAR(1)) FROM dbo.ApplicationSettingsELSE
SELECT @month = CAST(annualleaveyearstart AS CHAR(2)) FROM dbo.ApplicationSettingsBEGIN
-- Insert statements for procedure herereturn (CAST(@year+'-'+@month+'-'+@day AS SMALLDATETIME))END
END