+ Start a Discussion
chaitanya salesforcecrmchaitanya salesforcecrm 

How to Escape Commas in Number field and execute soql query?

When i try to search with 1000000 and 1500000 in Price Min and Max fields.the soql query is executing fine.but when i enter the values seperated with commas like SFmin=10,00,000 and SFmax=15,00,000.then i am getting error like
"System.QueryException: unexpected token: ,"User-added image
JyothsnaJyothsna (Salesforce Developers) 
Hi Chaitanya,

Remove commas from your values and apply them in the query.

Create a new custom field, where type is "formula" and the formula return type is "text".

In the formula, use the TEXT() function, and pass the existing number field value into this formula. For example, if your number field is MyNumber_c then your formula would be: TEXT( MyNumber_c )

Your users will enter values into the existing number field, but you can use the formula field (which doesn't display thousands separators)

Best Regards,
Jyothsna