I am trying to filter a list of memberships based on start dates. My filter consists of From date and To date. I want to get a list of memberships whose start date is between From and To date.

I am using a angular page with wordpress setup. Here is what I have tried so far with no success.

var membership = crmApi('Membership', 'get', {
          status_id: 2, // get memberships with status Current
          start_date_low: "2016-08-13",
          start_date_high: "2017-08-12",
          return: ['contact_id', 'membership_name', 'start_date', 'end_date', 'source']
return membership;

Done @petednz - fuzion

Solved it. I have used this. start_date: {"BETWEEN":["2016-08-13", "2017-08-12"]} Have got the info from support > Developer > API Explorer. I am a newbie in CiviCRM. Was not aware of such a helpful API Explorer.

| improve this answer | |

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.