The following stored procedure
CREATE PROCEDURE dbo.sp_return_applications_first_april
@Year int
AS
-- Create a variable @SQLStatement
DECLARE @SQLStatement varchar(255)
-- Enter the dynamic SQL statement into the
-- variable @SQLStatement
SELECT @SQLStatement = "from Applicants where convert(datetime, datefinished, 101) Between Cast('04/01/' + Cast(@Year)as varchar) as DateTime) AND convert(datetime, GETDATE(), 101) AND datefinished IS NOT NULL"
-- Execute the SQL statement
EXEC(@SQLStatement)
GO
gives me the following error when Im trying to execute it from an ASP page...
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'from'.
/apply/reporting/report.asp, line 50
Please help!!!
CREATE PROCEDURE dbo.sp_return_applications_first_april
@Year int
AS
-- Create a variable @SQLStatement
DECLARE @SQLStatement varchar(255)
-- Enter the dynamic SQL statement into the
-- variable @SQLStatement
SELECT @SQLStatement = "from Applicants where convert(datetime, datefinished, 101) Between Cast('04/01/' + Cast(@Year)as varchar) as DateTime) AND convert(datetime, GETDATE(), 101) AND datefinished IS NOT NULL"
-- Execute the SQL statement
EXEC(@SQLStatement)
GO
gives me the following error when Im trying to execute it from an ASP page...
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'from'.
/apply/reporting/report.asp, line 50
Please help!!!