CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Date Ranges for Smart Groups in Search Builder
Pages: [1]

Author Topic: Date Ranges for Smart Groups in Search Builder  (Read 1671 times)

vwishrad

  • Guest
Date Ranges for Smart Groups in Search Builder
August 20, 2009, 01:58:31 pm
I am trying to build a smart group of donors in CiviCRM. I’m using Search Builder and I would like to create a dynamic group that pulls people into the smart group based on their giving history. For example, I’d like to create a smart group for donors who made a gift within the last 24 months. Rather than create a static range --for example all donors with gift between 08/19/2007 and 08/19/2009 – I would rather base the select off the current date. I’m thinking it might look something like CURRENTDATE-24 months. I’m not sure how to make that work in Search Builder.

Any thoughts?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Date Ranges for Smart Groups in Search Builder
August 20, 2009, 04:38:25 pm

search builder does not support that. Your best bet would be to write a custom search (http://wiki.civicrm.org/confluence/display/CRMDOC/Custom+Search+Components) that does it, and build a smart group based on this custom search. You can potentially modify ContributionAggregate for this.

If you do so, please publish your custom search code, so others can benefit. Better yet, patch Contribution Aggregate so that we can incorporate this into core :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Date Ranges for Smart Groups in Search Builder

This forum was archived on 2017-11-26.