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 (Moderator: Dave Greenberg) »
  • Finding a list of contacts who've joined in the last year
Pages: [1]

Author Topic: Finding a list of contacts who've joined in the last year  (Read 5153 times)

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Finding a list of contacts who've joined in the last year
August 16, 2013, 03:16:36 am
Hi guys,

When I do a search on "Advanced Search" with the change logs set to "Added" (by is blank) and the two and from dates being a year from now, even if I only do today's date the server times out (504 gateway error). Any ideas? Ideally I need these to be grouped by a specific custom data field.

Does anyone know where the change logs are stored in mysql? Hopefully I can honour this request manually!

Thanks,
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Finding a list of contacts who've joined in the last year
August 16, 2013, 03:27:56 am
Can you try to reproduce on the demo site?

(and upgrade your profile to put the version of civi you are using, assuming you are not 1.0)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: Finding a list of contacts who've joined in the last year
August 16, 2013, 08:10:56 am
Updated profile information, I didn't have access to it back when I created the profile. Also, not sure where the demo site is, and as I'm using custom data wouldn't I need to add the custom data to the demo site for it to work?

So I've managed, somewhat, to figure out the issue.

I was told about the custom search "Date added to CiviCRM" which accepts date ranges: so I created a group of all the relevant users and applied that. This was to get the total count, but not grouped by the custom data.

The problem is that every time we want to do this search we (presumably?) need to create a new group? Or make sure that new records are added to this group?

The MySQL command took me most of the way there, but it was only for those modified within a certain time period, not for those added within that time period. I've included it below in case it's of service.

SELECT count(distinct(civicrm_value_contact_reference_9.entity_id)) from civicrm_value_contact_reference_9 INNER JOIN civicrm_log ON civicrm_value_contact_reference_9.entity_id=civicrm_log.entity_id where how_do_you_want_to_help LIKE '%donate%' AND civicrm_log.modified_date > "2012-07-01" AND modified_date < "2013-08-01";


If anyone could help me over the finish line here that'd be great!
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Finding a list of contacts who've joined in the last year
August 16, 2013, 12:01:26 pm
John - The first instance of a contact_id in civicrm_log carries the create date in the modified_date column, so I think if you do distinct on entity_id and order by modified_date you should get the create dates.

FYI - a created_date column has been added to the civicrm_contact table starting in v4.3.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Finding a list of contacts who've joined in the last year

This forum was archived on 2017-11-26.