comparing date is throwing error

200
0
11-06-2019 12:47 PM
tnarladni
New Contributor

I want to create a definition query to only view records where the month is 1 month ahead from current month. So for November, I want to view all December recrods, regardless of day.

Because it's the end of the year, I would have to account for the year as well so I wrote this:

format(DUE_DATE, 'yyMM') > format(DUE_DATE, 'yyMM')+1

This works when I write a sql select statement with a where clause in sql management studio on the table, but i'm getting syntax errors in the definition query dialog. 

Please help.

0 Kudos
0 Replies