I have a soql statement which is used to soql the result from a sObject but I need to mention the id in the soql how can add colon to the both side of id. my requirement
SELECT Result__c,Notes__c FROM Visits__c WHERE Is_latest__c = true and projectGroupId__c = '4390283nknfdkjs' and survey__c != null and Project_Group__c != null limit 1
But I am not getting the colon because of it the dynamic soql is getting error. my string soql
soqlQuery = 'SELECT '+ survey.Included_Questions__c +' FROM Visits__c WHERE Project_Group__r.id ='+projectGroupId+' and Is_latest__c = true and survey__c != null and Project_Group__c != null limit 1';
please guide me how to achieve it.