Given the snippet shown, it should work, but that is why we need to see the actual SQL, not parts of it.
The error about syntax or missing operator suggests the problem is elsewhere in that SQL, so that's what we need to evaluate.
Also, please confirm that DateCost is a datetime datatype...