I am using dynamic SOQL and trying to get the count of a query result but I am getting an exception. I have done some research to find a solution and found that it isn't possible to use complex bind variables in dynamic SOQL yet.
count = database.countQuery('Select Id from Lead where Admission_Status__c IN : setStatus and Intake_Year__c =:objLead.Intake_Year__c and Intake_Month__c =:objLead.Intake_Month__c and Program__c=:objLead.Program__c');
So can anybody confirm that my understanding is correct? For now I am going to achieve the count with static SOQL and using the size function.