1

Hi i want help in soql query, i want the record that are multiple of 12 for Age__c number field. For example if record that has age field as 12, it should return the record, if 23 no record. How to achieve this?

SELECT Id, Name,Age__c FROM subtype__c 
0
4

Create list of integer with multiple of 12, And pass the list into SOQL"IN"

List<integer > ageList=new List<integer >();  
for(integer i=1;i<10;i++)
    ageList.add(i*12);

List<subtype__c> subtypes=[SELECT Id, Name,Age__c FROM subtype__c where Age__c in : ageList];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.