You need to sign in to do that
Don't have an account?
Case statement in SOQL?
Hi all,
Is it possible to have a case statement in a SOQL query? I am attempting to combine multiple lookup fields that are various contacts associated with a contract into a single related list, where the list would contain the specific role of the contact (signee, contractee, a few custom fields, etc.). Is SQL i'd do this with a case statement but SOQL doesn't seem to like it. Any thoughts? Here's my query:
Select id, Name, Status, Amount__c, Contract_Date__c
from Contract
where CompanySignedID = :con.id
or OwnerID = :con.id
or CustomerSignedID = :con.id
or Consultant__c = :con.id
or Signee__c = :con.id
or Organization_Contact__c = :con.id
If SOQL doesn't do case statements, any ideas how I could designate which of these fields the contact is assiged to?
Thanks,
Hassab