Hi, I am new to sql statements, just wondering if anyone can help me sort out the syntax error I am getting. I am not sure what's wrong...
SET @SQL = @SQL + ' WHEN OEMP.eMPLOYEEACTIVE = ''INACTIVE'' AND payYTDDeductions.pCheckDate BETWEEN ''' + convert(varchar, @StartDate, 101) + ''' AND ''' convert(varchar, @EndDate, 101) + ''' ' +CHAR(13)
SET @SQL = @SQL + ' AND DATEDIFF(YY,''' + convert(varchar, @StartDate, 101) + ''' , OEMP.INACTIVEDATE)<=1 ' + CHAR(13)
The syntax error has to to with, or is near the convert, but not sure how to change it
Syntax error
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Guest UserRank #1,422 · 1.2K reputationPosted Dec 17, 2010, 6:56 AM EST