1
Answer

Syntax error

Janine

Janine

14y
6.9k
1

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
Answers (1)