Janine

Janine

  • NA
  • 8
  • 41.8k

Syntax error

Dec 17 2010 9:21 AM

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)