function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShaTShaT 

Database Query Problem

Hi ,

 

I have a field with decimal type. i m filtering it in my query , it is giving me following error.

System.QueryException: value of filter criterion for field 'Price__c' must be of type double and should not be enclosed in quotes


Price__c is currency type

and price is deimal type and i have tried double also

 

 Follwoing Query i m excuting -:

string property ='Select p.Vacant_or_Occupied__c, p.Property_Type__c, p.Price__c, p.Name, p.Location__c, p.Bedrooms__c, p.Available__c From Property__c p where Name != null';

 

if(price != null){
property += ' And Price__c = \''+price+'\'';
}

database.query(property);

 

 

Thanks

Shailu

 

Best Answer chosen by Admin (Salesforce Developers) 
salesforce expertsalesforce expert

property += ' And Price__c = '+price;

 

this will works for you! let me know!

 

baskaran