In the past I had problems with date formats in set analysis.I'm not sure if this can be your case.
I used to create a field where the date is a simple integer. In script, this can be done with a simple num():
num(RECORD_DATE) as nDate
Then, vToday would also be a number:
vToday = num(today() ) ;
Thus, set analysis will become:
Hope this helps,