You need to sign in to do that
Don't have an account?
arjunkodidalasfdc1.3904276015566733E12
SOQL OR condition
Hi,
I need to write a soql query with AND and OR condition.
string member='1234';
string group='6789';
Select ID from contact where firstname=:fname AND lastname:=lname AND memberid__c=:member OR group__c=:group.
I know the above query is wrong. I need to check few fields with AND condition and few fields with OR condition.
Can any one please correct this query.
Thanks.
I need to write a soql query with AND and OR condition.
string member='1234';
string group='6789';
Select ID from contact where firstname=:fname AND lastname:=lname AND memberid__c=:member OR group__c=:group.
I know the above query is wrong. I need to check few fields with AND condition and few fields with OR condition.
Can any one please correct this query.
Thanks.
Select ID from contact where (firstname=:fname AND lastname:=lname) AND (memberid__c=:member OR group__c=:group)
read more: http://www.salesforce.com/us/developer/docs/soql_sosl/index.htm : Condition Expression Syntax (WHERE Clause)
All Answers
Select ID from contact where (firstname=:fname AND lastname:=lname) AND (memberid__c=:member OR group__c=:group)
read more: http://www.salesforce.com/us/developer/docs/soql_sosl/index.htm : Condition Expression Syntax (WHERE Clause)