Answers.Body: <p>Oh, I've found in my crm menu Support - Develper - API Explorer and there was a solution:</p>
  
  <pre><code>start_date: {'BETWEEN': ['2015-01-01', '2016-01-01']},
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-09T12:54:22.263Z
Answers.LastActivityDate: 2016-10-09T12:54:22.263Z
Answers.UserDisplayName: Somerussian
Body: <p>I want to get all memberships with start date between '2016-01-01' and '2016-06-01' using crmApi(). Here's my code that's not working:</p>
  
  <pre><code>  angular.module('angularmemberships').config(function($routeProvider) {
    $routeProvider.when('/memberships', {
      controller: 'AngularmembershipsMembershipsCtrl',
      templateUrl: '~/angularmemberships/MembershipsCtrl.html',
  
      resolve: {
        memberships: function(crmApi) {
          return crmApi('Membership', 'get', {
            sequential: true,
            rowCount: 100,
            start_date: ['2016-01-01', '2016-06-01'],
            sort: 'start_date DESC',
          });
        },        
      }
    });
  }
  );
  </code></pre>
  
  <p>If I specify single date (start_date: '2016-01-01') it works (returns rows fot that date), but how do I get rows for a date range?</p>
  
Tags: <ajax>
Title: HowTo: crmApi get rows with date between
ThreadText: # HowTo: crmApi get rows with date between
  
  (Asked by: username_0 on 2016-10-09)
  
  I want to get all memberships with start date between '2016-01-01' and '2016-06-01' using crmApi(). Here's my code that's not working:
    angular.module('angularmemberships').config(function($routeProvider) {
    $routeProvider.when('/memberships', {
      controller: 'AngularmembershipsMembershipsCtrl',
      templateUrl: '~/angularmemberships/MembershipsCtrl.html',
  
      resolve: {
        memberships: function(crmApi) {
          return crmApi('Membership', 'get', {
            sequential: true,
            rowCount: 100,
            start_date: ['2016-01-01', '2016-06-01'],
            sort: 'start_date DESC',
          });
        },        
      }
    });
  }
  );
  
  If I specify single date (start_date: '2016-01-01') it works (returns rows fot that date), but how do I get rows for a date range?
  
  **Tags:** ajax
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-10-09. Score: 2
  
  Oh, I've found in my crm menu Support - Develper - API Explorer and there was a solution:
  start_date: {'BETWEEN': ['2015-01-01', '2016-01-01']},
  
  
  ---
  
  