Can someone tell me what is wrong with this function. I am receiving an error near begin on line 200. I have display part of my code.
CREATE FUNCTION dbo.fn_MonthlyUpdatesCalculation (@StartDate datetime, @EndDate datetime)
RETURNS TABLE
AS
BEGIN
DECLARE @MinAudits int, @WorkDays int
SET @MinAudits = 40
SET @WorkDays =
DATEDIFF("d", @StartDate, @EndDate) / 7 * 5
RETURN(SQL Statement)
END
When I remove the sql statement and run it I receive no error messages.
Thanks
CREATE FUNCTION dbo.fn_MonthlyUpdatesCalculation (@StartDate datetime, @EndDate datetime)
RETURNS TABLE
AS
BEGIN
DECLARE @MinAudits int, @WorkDays int
SET @MinAudits = 40
SET @WorkDays =
DATEDIFF("d", @StartDate, @EndDate) / 7 * 5
RETURN(SQL Statement)
END
When I remove the sql statement and run it I receive no error messages.
Thanks