Answers.Body: <p>I think a patch for this is now being pushed to core for 4.6 and 4.7. Thanks to the Fuzion team! </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T07:08:17.580Z
Answers.Text: A patch has been provided in https://issues.civicrm.org/jira/browse/CRM-19675 but it hasn't been accepted yet.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-01T11:42:57.497Z
Answers.LastActivityDate: 2016-09-01T11:42:57.497Z
Answers.UserDisplayName: Andyg8
Answers.Body: <p>You don't say what version of CiviCRM you're using, but I can do this using the Advanced Search function. Using this search I can filter by event types and use relative dates for the event start date. It's under the event panel when you're adding in your filters. This will give you a list of unique contacts that meet the criteria.</p>
  
  <p>If you want to see all registrations (including each registration for people on more than one course) you can use the Find Participants search in the events menu. </p>
  
  <p>Or you can also use the "display results as" feature in the advanced search if you want to build up your search with other non-event data. So you can filter on all criteria in the advanced search and then "display results as" participants to see the unique registrations.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-12T09:08:14.690Z
Answers.Text: Thanks Heather O... I should have added that I'm on 4.6.14. And as you say, everything is there in the Advanced Search feature... except the ability to do relative dates of arbitrary length. 
  
  For a date field like Event start date, I can happily search for '1 month ago', '1 quarter ago', '1 year ago'... but I can't see a way to search for say '10 months ago', or '20 months ago'. I can be a bit flexible on the durations I need here, but I do need various lengths between 1 quarter, 1 year, 2 years and 3 years.
  
  Hence exploring the Search builder, but that doesn't seem to allow relative dates.
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-13T07:37:52.700Z
Answers.Text: You're right Andyg8, there are fixed relative dates that CiviCRM provides. You'll see these date options in the reports too. Without customising CiviCRM, you're options would be to work with the existing relative dates, or use standard groups and manually run the search at a set frequency and add appropriate people into the groups. Alternately, you could look at adjusting CiviCRM to include your required dates.
Answers.UserDisplayName: Heather O.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-13T13:01:56.380Z
Answers.Text: Yes, good conclusions. Thanks! Regarding customising, can you point me in the direction of how to 'adjust Civicrm to include' those required dates?
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-13T13:25:08.433Z
Answers.Text: It's not something I've done before, but there's a few issues logged around renaming and the following stack exchange post links to those: http://civicrm.stackexchange.com/questions/4815/is-it-possible-to-customize-the-automatic-date-ranges-in-advanced-search Would be a good starting point I think :)
Answers.UserDisplayName: Heather O.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T10:43:05.407Z
Answers.Text: Thanks! Very helpful. It seems 4.8 will offer huge flexibility on this point.
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-12T07:30:58.333Z
Answers.LastActivityDate: 2016-04-12T07:30:58.333Z
Answers.UserDisplayName: Heather O.
Body: <p>I'm trying to setup a search that finds participants for:</p>
  
  <ul>
  <li>a specified event type,  </li>
  <li>with events that have started within a
  variety of time periods relative to today: I need to be able to find
  events that have started within the last 3 months, 6 months, 9
  months, 12, 15 months... etc. I have a fairly wide variety of time
  periods I need to search.</li>
  </ul>
  
  <p>This will be used to grant access to course materials relevant to various stages through a 3 year course. </p>
  
  <p>But in search builder, I do not see an opportunity to search event types, nor to search date fields based on relative dates. </p>
  
  <p>Are these two features possible in any of the search facilities?</p>
  
  <p>Thanks!</p>
  
Tags: <search><search-builder>
Title: Search builder participants - relative start dates and event types
ThreadText: # Search builder participants - relative start dates and event types
  
  (Asked by: username_0 on 2016-04-12)
  
  I'm trying to setup a search that finds participants for:
  
  * a specified event type,
  * with events that have started within a
    variety of time periods relative to today: I need to be able to find
    events that have started within the last 3 months, 6 months, 9
    months, 12, 15 months... etc. I have a fairly wide variety of time
    periods I need to search.
  
  This will be used to grant access to course materials relevant to various stages through a 3 year course.
  
  But in search builder, I do not see an opportunity to search event types, nor to search date fields based on relative dates.
  
  Are these two features possible in any of the search facilities?
  
  Thanks!
  
  **Tags:** search, search-builder
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-09-01. Score: 1 | Accepted answer
  
  I think a patch for this is now being pushed to core for 4.6 and 4.7. Thanks to the Fuzion team!
  
  > **Comments:**
  > **username_1**: A patch has been provided in https://issues.civicrm.org/jira/browse/CRM-19675 but it hasn't been accepted yet.  
  
  ---
  
  ### Answer by username_2 on 2016-04-12. Score: 1
  
  You don't say what version of CiviCRM you're using, but I can do this using the Advanced Search function. Using this search I can filter by event types and use relative dates for the event start date. It's under the event panel when you're adding in your filters. This will give you a list of unique contacts that meet the criteria.
  
  If you want to see all registrations (including each registration for people on more than one course) you can use the Find Participants search in the events menu.
  
  Or you can also use the "display results as" feature in the advanced search if you want to build up your search with other non-event data. So you can filter on all criteria in the advanced search and then "display results as" participants to see the unique registrations.
  
  > **Comments:**
  > **username_0**: Thanks username_2.. I should have added that I'm on 4.6.14. And as you say, everything is there in the Advanced Search feature... except the ability to do relative dates of arbitrary length.   For a date field like Event start date, I can happily search for '1 month ago', '1 quarter ago', '1 year ago'... but I can't see a way to search for say '10 months ago', or '20 months ago'. I can be a bit flexible on the durations I need here, but I do need various lengths between 1 quarter, 1 year, 2 years and 3 years.  Hence exploring the Search builder, but that doesn't seem to allow relative dates.  
  > **username_2**: You're right username_0, there are fixed relative dates that CiviCRM provides. You'll see these date options in the reports too. Without customising CiviCRM, you're options would be to work with the existing relative dates, or use standard groups and manually run the search at a set frequency and add appropriate people into the groups. Alternately, you could look at adjusting CiviCRM to include your required dates.  
  > **username_0**: Yes, good conclusions. Thanks! Regarding customising, can you point me in the direction of how to 'adjust Civicrm to include' those required dates?  
  > **username_2**: It's not something I've done before, but there's a few issues logged around renaming and the following stack exchange post links to those: http://civicrm.stackexchange.com/questions/4815/is-it-possible-to-customize-the-automatic-date-ranges-in-advanced-search Would be a good starting point I think :)  
  > **username_0**: Thanks! Very helpful. It seems 4.8 will offer huge flexibility on this point.  
  
  ---
  
  