Hi Salvatore,
Exact, it is a date format type issue.
Firstly, try to force your variable to have date or datetime format (either in Javascript in the variable declaration, or in the Worfklow properties, Variables tab.
Otherwise use the formatDate or other JS methods to convert to date. But if it is in the Query activity wizard, use the ToDateTime in the Expression editor :
Regards
JS