Hello,I have the following SP, but it's not letting me include the GetDate function within my parameter declarations.This is what I have: CREATE PROCEDURE dbo.admin_GetAllJobs @Archive bit = 0, @searchString varchar(10) = GetDateASDECLARE @searchDate datetimeDECLARE @searchMonth intDECLARE @searchYear intSELECT @searchDate = CONVERT(datetime, @searchString)SELECT @searchMonth = DATEPART(month, @searchDate)SELECT @searchYear = DATEPART(year, @searchDate)IF @Archive = 1 SELECT V.RefNo, V.JobTitle, L.LocationName, V.whShort, V.typeID, V.ExpDate, V.locSpecific, V.locID FROM JobVacancies V INNER JOIN Locations L ON V.locID = L.[ID] WHERE DATEDIFF(month, V.ExpDate, @searchMonth) = 0 AND DATEDIFF(year, V.ExpDate, @searchYear) = 0 AND V.Archived = @Archive ORDER BY V.RefNoELSE SELECT V.RefNo, V.JobTitle, L.LocationName, V.whShort, V.typeID, V.ExpDate, V.locSpecific, V.locID FROM JobVacancies V INNER JOIN Locations L ON V.locID = L.[ID] WHERE DATEDIFF(month, V.ExpDate, @searchMonth) >= 0 AND DATEDIFF(year, V.ExpDate, @searchYear) >= 0 AND V.Archived = @Archive ORDER BY V.RefNoGO
But it keeps complaining of "Syntax error converting datetime from character string."Am I doing this wrong, or is there something stupid I haven't done yet?Thanks.