Answers.Body: <p>This was a bug in Core CiviCRM which is now fixed starting from version 4.7.14.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-04T07:42:57.223Z
Answers.LastActivityDate: 2017-03-04T07:42:57.223Z
Answers.UserDisplayName: Aivars
Body: <p>How can I setup a Smart Group to include members based on relative dates (e.g. last Activity)?</p>
  
  <p>When I try to use relative date, e.g. <em>Yesterday</em> in advanced search, it correctly finds users with Activity on previous day, but when I create a <strong>Smart Group</strong> out of that search, it seems to fix the date in search criteria. As a result the next day smart group now contains members with Activity on the day <strong>before</strong> yesterday.</p>
  
  <p>Neither running <strong>Rebuild Smart Group Cache</strong> (no parameters) nor clicking <strong>Update Smart Group Counts</strong> helped.</p>
  
  <p>Am I missing something obvious?</p>
  
  <p>Wordpress: 4.5.3
  CiviCRM: 4.7.9</p>
  
  <p><a href="https://i.sstatic.net/U0HTh.png" rel="noreferrer"><img src="https://i.sstatic.net/U0HTh.png" alt="enter image description here"></a></p>
  
  <p>Tried to create a <em>Smart Group</em> in <strong>CiviCRM Sandbox on Drupal</strong> and it seems Activity Date gets fixed immediately when trying to create a <em>Smart Group</em> from <em>Advanced Search</em>.
  <a href="https://i.sstatic.net/fvnsW.jpg" rel="noreferrer"><img src="https://i.sstatic.net/fvnsW.jpg" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-18T13:18:33.213Z
Comments.Text: Your query is similar to [this question](http://civicrm.stackexchange.com/questions/12278/smart-group-change-log-creteria/12300#12300) although because the author had stated their intentions they were able to get a workaround. You're correct that the search and smart group function doesn't keep the smart group dates as a relative search and instead translates it but, if you're able to, could you expand on your question and let people know what you're trying to achieve?
Comments.UserDisplayName: Matt Lind
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-18T14:00:19.980Z
Comments.Text: @MattLind I am afraid that the scale of my intentions will prohibit simple workaround. I'd like to create multiple smart groups in such a way that a contact is changing the groups (depending on the relative time of activities).
Comments.UserDisplayName: Aivars
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-18T15:10:30.960Z
Comments.Text: Sounds fun =) What will you be looking to do with the contacts when they are in the different smart groups? e.g. If it's just a case of seeing people's relative time from an activitiy then reports might be a better place to look.
Comments.UserDisplayName: Matt Lind
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-18T15:12:56.217Z
Comments.Text: I'd like to use multiple parameters for filtering users. E.g. Group A: Activity X, if before 30 days. Group B: Activity X, if during last 30 days. Group C: Activity Y, if before 14 days. Group D: Activity Y, if during 14 days. It is not that I'd like to only see relative time of all people. I'd rather like to see people in different categories, depending on multiple parameters (often 3 or 4), so that I can meaningfully interact with each category.
Comments.UserDisplayName: Aivars
Tags: <smartgroups><dates>
Title: How to use Smart Groups with relative dates?
ThreadText: # How to use Smart Groups with relative dates?
  
  (Asked by: username_0 on 2016-08-17)
  
  How can I setup a Smart Group to include members based on relative dates (e.g. last Activity)?
  
  When I try to use relative date, e.g. *Yesterday* in advanced search, it correctly finds users with Activity on previous day, but when I create a **Smart Group** out of that search, it seems to fix the date in search criteria. As a result the next day smart group now contains members with Activity on the day **before** yesterday.
  
  Neither running **Rebuild Smart Group Cache** (no parameters) nor clicking **Update Smart Group Counts** helped.
  
  Am I missing something obvious?
  
  Wordpress: 4.5.3
  CiviCRM: 4.7.9
  
  [![enter image description here](https://i.sstatic.net/U0HTh.png)](https://i.sstatic.net/U0HTh.png)
  
  Tried to create a *Smart Group* in **CiviCRM Sandbox on Drupal** and it seems Activity Date gets fixed immediately when trying to create a *Smart Group* from *Advanced Search*.
  [![enter image description here](https://i.sstatic.net/fvnsW.jpg)](https://i.sstatic.net/fvnsW.jpg)
  
  **Tags:** smartgroups, dates
  
  > **Comments:**
  > **username_1**: Your query is similar to [this question](http://civicrm.stackexchange.com/questions/12278/smart-group-change-log-creteria/12300#12300) although because the author had stated their intentions they were able to get a workaround. You're correct that the search and smart group function doesn't keep the smart group dates as a relative search and instead translates it but, if you're able to, could you expand on your question and let people know what you're trying to achieve?  
  > **username_0**: @MattLind I am afraid that the scale of my intentions will prohibit simple workaround. I'd like to create multiple smart groups in such a way that a contact is changing the groups (depending on the relative time of activities).  
  > **username_1**: Sounds fun =) What will you be looking to do with the contacts when they are in the different smart groups? e.g. If it's just a case of seeing people's relative time from an activitiy then reports might be a better place to look.  
  > **username_0**: I'd like to use multiple parameters for filtering users. E.g. Group A: Activity X, if before 30 days. Group B: Activity X, if during last 30 days. Group C: Activity Y, if before 14 days. Group D: Activity Y, if during 14 days. It is not that I'd like to only see relative time of all people. I'd rather like to see people in different categories, depending on multiple parameters (often 3 or 4), so that I can meaningfully interact with each category.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-03-04. Score: 5 | Accepted answer
  
  This was a bug in Core CiviCRM which is now fixed starting from version 4.7.14.
  
  
  ---
  
  