ERROR DATATYPE MISMATCH 1629 The data supplied is the wrong type

ERROR DATATYPE MISMATCH 1629 The data supplied is the wrong type.
How many have experienced this?
I use to have a webI R1 report which had user response.
Although I did not use the quotes in the function my code was working fine.
But after I transferred to R2 the same code shows me an error datatype mismatch once I put the numbers in quotes everything was fine.
Why is this so?
