I am trying to update a field in a table.

EXCSQLSTM SQLSTM('UPDATE "table1" SET field1 = +
(SELECT COUNT(*) FROM +
"table2" WHERE field2 = +
''XXXXXXX'' AND field3 = +
YEAR(CURDATE())*10000+MONTH(CURDATE())*100++
Day(CURDATE())) WHERE field4 = +
''XXXXXXX''' )

This statement works for dates formatted 20040210, but I need to update another table which uses a date format of 2004-02-10. I have tried to use a variable '&var' but it appears to read it litterally instead of the value it contains.

I would be greatful for any help.

Thanks