Without knowing Crystal Reports, it seems likely that the issue is the function you are using. If you are converting a value ToText
then the amswer will be considered a character string, even if the contents happen to be numeric characters.
You are on the right rack with your T-SQL expression.
To get the numeric result that you can use in a record selection clause, try something like this:
dec( replace(char(current_date - 1 day),'-','') ,8,0)