Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I execute SOQL in Developer Console:

Select Id, Amount From Opportunity Where Amount > 10000000000

An parsing error occurs:

Unknown error parsing query

Is there length limit of number on SOQL Where condition?

share|improve this question
1  
Funny enough the query will work if you added ".0" at the end to be 10000000000.0 – Amr Ibrahim Jan 19 at 5:53
up vote 6 down vote accepted

According to your query you are passing 10000000000 which is a 11 digit Integer value.

In Salesforce or Java Integer can not be bigger than 2,147,483,647. Current value you are passing is considered as Integer and exceeds the given number so error is given.

Try adding decimal. Decimal can be bigger upto 2 raise to power 63 - 1. So this will work:

Select Id, Amount From Opportunity Where Amount > 10000000000.0

Compiler will understand that it is a decimal.

share|improve this answer

As per document ..

Maximum number we can use is 2,147,483,647.

Integer

A 32-bit number that does not include a decimal point. Integers have a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647. For example:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_primitives.htm

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.