sql - soql query in salesforce -
aggregateresult[] groupedresultcall = [ select account_vod__c, count(id) call2_vod__c call_date_vod__c >= :quarterstartdate , call_date_vod__c <= :quarterenddate , account_type__c =: accstaticrec.account_type__c , territory_vod__c =: accstaticrec.territory__c , status_vod__c = 'submitted_vod' , (call_type_vod__c != 'call only' or call_type_vod__c != 'event only' or call_type_vod__c != 'event detail') , account_vod__c in :accidset , activity_type__c <> 'staff' group account_vod__c ]; aggregateresult[] groupedresultcall = [select account_vod__c, count(id) call2_vod__c call_date_vod__c >= :quarterstartdate , call_date_vod__c <= :quarterenddate , account_type__c =:accstaticrec.account_type__c , territory_vod__c = :accstaticrec.territory__c , status_vod__c = 'submitted_vod' , (call_type_vod__c != 'call only' , call_type_vod__c != 'event only' , call_type_vod__c != 'event detail') , account_vod__c in :accidset , activity_type__c <> 'staff' group account_vod__c ];
which query correct. please correct me
2nd 1 correct.
and (call_type_vod__c != 'call only' , call_type_vod__c != 'event only' , call_type_vod__c != 'event detail')
i think want retrieve rows 'call_type_vod__c' value other these values ('call only', 'event only', 'event detail') . 2nd work.
1st query return rows
and (call_type_vod__c != 'call only' or call_type_vod__c != 'event only' or call_type_vod__c != 'event detail')
Comments
Post a Comment