+ Start a Discussion
Peter KrugerPeter Kruger 

SOQL Confusion! - If something = something then show something!

Hi Guys,

Pretty new to using SOQL but trying to run a query for an external report that we want to generate but need to join two tables in salesforce in order to do that. What i am trying to achieve is to show a description of the services they are entitled to- Secon Services contains the description and names and Entitlements contains what they actually have ... all very confusing if you have how I can do the below query 

SELECT Service_Type__c FROM Entitlement WHERE AccountId = 'X'

 IF Service_Type__c FROM Entitlement  = 'CARE Contract' THEN  - How do i do this to link the to querys?

SELECT Name, Description FROM Secon_Services__c WHERE Name = 'CARE Contract'
Atul GuptaAtul Gupta
Peter, do Secon_Services__c  have a lookup field to Entitlement or the other way around?
Tavva Sai KrishnaTavva Sai Krishna
Peter, is there any relationship between Entitlement__C and Secon_Services__C objects .or can you give more details about your scenario.

Sai Krishna Tavva.