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
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.

Regards,
Sai Krishna Tavva.